ON_Big5CodePoint is a tool to use when working with BIG5 encoded strings.
More...
#include <opennurbs_unicode.h>
|
| ON_Big5CodePoint ()=default |
|
| ON_Big5CodePoint (const ON_Big5CodePoint &)=default |
|
| ~ON_Big5CodePoint ()=default |
|
unsigned int | Big5CodePoint () const |
|
int | Encode (char *buffer, size_t buffer_capacity) const |
|
bool | IsASCII (bool bNullIsASCII) const |
| Strictly speaking, BIG5 does not extend ASCII, but it is common to mix single bytes ASCII and double byte BIG5 encodings in the same char string. BIG5 is a double byte string encoding with the first byte in the range 0x81 to 0xFE, the minimum BIG5 code point is 0x8140 and the maximum BIG5 code point is 0xFEFE. Thus it is possible to mix ASCII and BIG5 encodings in the same char string. More...
|
|
bool | IsNull () const |
| Determine if this BIG5 code point is 0. More...
|
|
bool | IsPrivateUse () const |
| BIG5 code points in the ranges 0xC6A1-0xC8FE, 0xC6A1-0xC8FE, and 0xF9D6-0xFEFE are for private use (user defined characters). More...
|
|
bool | IsStandard (bool bNullIsValid, bool bASCIICodePointIsValid) const |
| BIG5 code points in the ranges0xA140-0xA3Bf, 0xA440-0xC67E, and 0xC940-0xF9D5 are standard code points. More...
|
|
bool | IsValid (bool bNullIsValid, bool bASCIICodePointIsValid) const |
| Determine if the pair of code points is valid. If the values for BIG5 and Unicode code point values are < 0xFF and equal, the pair is considered valid. Use IsASCII() if you need to treat nonzero ASCII code points differently. More...
|
|
ON_Big5CodePoint & | operator= (const ON_Big5CodePoint &)=default |
|
ON_Big5CodePoint is a tool to use when working with BIG5 encoded strings.
◆ anonymous enum
anonymous enum : unsigned int |
Enumerator |
---|
MinimumCodePoint | |
MinimumPrivateUseCodePoint | |
MinimumStandardCodePoint | |
MaximumStandardCodePoint | |
MaximumPrivateUseCodePoint | |
MaximumCodePoint | |
◆ ON_Big5CodePoint() [1/2]
ON_Big5CodePoint::ON_Big5CodePoint |
( |
| ) |
|
|
default |
◆ ~ON_Big5CodePoint()
ON_Big5CodePoint::~ON_Big5CodePoint |
( |
| ) |
|
|
default |
◆ ON_Big5CodePoint() [2/2]
◆ Big5CodePoint()
unsigned int ON_Big5CodePoint::Big5CodePoint |
( |
| ) |
const |
◆ Compare()
◆ Create()
static const ON_Big5CodePoint ON_Big5CodePoint::Create |
( |
unsigned int |
big5_code_point | ) |
|
|
static |
Creates a BIG5 code point with the specified code point value.
- Parameters
-
big5_code_point | A valid BIG5 code point, ASCII code point (0x00-0x7E), or the old Windows Euro currency symbol code point 0xA3E1 in the reserved area. |
- Returns
- If big5_code_point is valid BIG5 code point or an ASCII code point, then a ON_Big5CodePoint instance with that value as code point is returned. Otherwise ON_Big5CodePoint::Error is returned.
◆ CreateFromUnicode() [1/2]
Find a BIG5 code point with the same character as unicode_code_point.
- Parameters
-
unicode_code_point | |
not_available | Value to return when unicode_code_point is valid but does not mapt to a BIG5 code point. |
- Returns
- If there is a corresponding BIG5 or ASCII code point, that code point is returned. Otherwise, if unicode_code_point is valid, not_available is returned. Otherwise ON_Big5CodePoint::Error is returned.
◆ CreateFromUnicode() [2/2]
Find a BIG5 code point with the same character as unicode_code_point.
- Parameters
-
unicode_code_point | |
not_available | Value to return when unicode_code_point is valid but does not mapt to a BIG5 code point. |
- Returns
- If there is a corresponding BIG5 or ASCII code point, that code point is returned. Otherwise, if unicode_code_point is valid, not_available is returned. Otherwise ON_Big5CodePoint::Error is returned.
◆ Decode()
static const char* ON_Big5CodePoint::Decode |
( |
const char * |
buffer, |
|
|
size_t |
buffer_count, |
|
|
bool |
bParseNull, |
|
|
bool |
bParseASCII, |
|
|
ON_Big5CodePoint * |
big5_code_point |
|
) |
| |
|
static |
◆ Encode()
int ON_Big5CodePoint::Encode |
( |
char * |
buffer, |
|
|
size_t |
buffer_capacity |
|
) |
| const |
◆ IsASCII()
bool ON_Big5CodePoint::IsASCII |
( |
bool |
bNullIsASCII | ) |
const |
Strictly speaking, BIG5 does not extend ASCII, but it is common to mix single bytes ASCII and double byte BIG5 encodings in the same char string. BIG5 is a double byte string encoding with the first byte in the range 0x81 to 0xFE, the minimum BIG5 code point is 0x8140 and the maximum BIG5 code point is 0xFEFE. Thus it is possible to mix ASCII and BIG5 encodings in the same char string.
- Parameters
-
- Returns
- True if the code point value &le= 0x7F.
◆ IsNull()
bool ON_Big5CodePoint::IsNull |
( |
| ) |
const |
Determine if this BIG5 code point is 0.
- Returns
- True if the code point value is 0.
◆ IsPrivateUse()
bool ON_Big5CodePoint::IsPrivateUse |
( |
| ) |
const |
BIG5 code points in the ranges 0xC6A1-0xC8FE, 0xC6A1-0xC8FE, and 0xF9D6-0xFEFE are for private use (user defined characters).
- Returns
- True if this BIG5 code point is a private use (user defined) code point.
◆ IsStandard()
bool ON_Big5CodePoint::IsStandard |
( |
bool |
bNullIsValid, |
|
|
bool |
bASCIICodePointIsValid |
|
) |
| const |
BIG5 code points in the ranges0xA140-0xA3Bf, 0xA440-0xC67E, and 0xC940-0xF9D5 are standard code points.
- Parameters
-
bNullIsValid | Value to return if the code point value is 0. |
bASCIICodePointIsValid | Value to return if the code point value is an ASCII code point (<= 0x7F). |
- Returns
- Returns true this BIG5 code point is a standard code point.
◆ IsValid()
bool ON_Big5CodePoint::IsValid |
( |
bool |
bNullIsValid, |
|
|
bool |
bASCIICodePointIsValid |
|
) |
| const |
Determine if the pair of code points is valid. If the values for BIG5 and Unicode code point values are < 0xFF and equal, the pair is considered valid. Use IsASCII() if you need to treat nonzero ASCII code points differently.
- Parameters
-
bNullIsValid | Value to return if the code point value is 0. |
bASCIICodePointIsValid | Value to return if the code point value is an ASCII code point (<= 0x7F). |
- Returns
- True if the code point value is a valid BIG5 code point.
◆ operator=()
◆ Error
◆ Null
ON_Big5CodePoint::NUll has a code point value = 0.
◆ WindowsEuro
ON_Big5CodePoint::Error has a code point value = 0xA3E1. 0xA3E1 is in the BIG5 reserved section but old versions of Windows mapped it to the Euro currency symbol. The main use of this code is to translate from legacy BIG5 to Unicode, so this anomaly is supported.