InvalidStringException

Summary

Represents an exception for invalid strings, such as strings containing UCS high surrogate characters without a corresponding low surrogate character. Note that such a string cannot usually be constructed in JS++ as it is typically a parser error but such problems can originate from external code.

Description

Represents an exception for invalid strings, such as strings containing UCS high surrogate characters without a corresponding low surrogate character. Note that such a string cannot usually be constructed in JS++ as it is typically a parser error but such problems can originate from external code.

Examples

Example of how this exception might be encountered
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import System;
import System.Exceptions;
import System.Encoding;
 
try {
    // High surrogate character without a corresponding low surrogate.
    // This code is commented because it's not valid JS++ code and is
    // being used for illustrative purposes, but it can originate from an
    // external string.
 
    // UTF8.encode("\uD800");
}
catch(InvalidStringException e) {
    Console.error(e);
}

Methods

Share

HTML | BBCode | Direct Link