Accessibility
In file IEncodingUtils.h:

Utils API

class IEncodingUtils

It serves as a helper class that facilitates the conversion of multi-byte characters across various encoding standards.

Inheritance:


[more]virtual PMString CharacterCodeToString(textchar code, encodingType encoding) = 0
It returns a PMString representing the given textchar in the given encoding.
[more]virtual void DoubleByteEncoding2unicode( textchar &ch, uint8 script = -1 ) = 0
It converts a double byte textchar to its equivalent unicode encoding based on the script.
[more]virtual bool16 DoubleByteIsValidUnicode(const textchar &inChar, uint8 script = -1 ) = 0
It checks if the textchar is defined in UNICODE
[more]virtual textchar FontBasedPlatformEncoding2Unicode( PlatformChar platformChar, IPMFont* transFont ) = 0
[more]virtual PlatformChar FontBasedUnicode2PlatformEncoding( textchar unicodeChar, IPMFont* transFont, uint8 script = -1 ) = 0
[more]virtual textchar GetHexCode(PMString& s) = 0
It extracts the hexadecimal value from up to the first 4 bytes of the given PMString representing a hexadecimal code, and returns it as a textchar.
[more]virtual textchar GetKutenCode(PMString& s) = 0
It extracts the Kuten code value from up to the first 5 bytes of the given PMString representing a decimal Kuten code, and returns it as a textchar.
[more]virtual int32 IntValue(uchar c) = 0
It returns the integer value of a hexadecimal character
[more]virtual bool16 IsDecimal(uchar c) = 0
It returns whether or not the given character is a decimal character ('0'- '9')
[more]virtual bool16 IsDoubleByteScript(int8 script) = 0
[more]virtual bool16 IsHex(uchar c) = 0
It returns whether or not the given character is a hexadecimal character ('0'-'9', 'A'-'F' or 'a'-'f')
[more]virtual bool16 IsPossibleLeadByte(uchar charByte, int8 script) = 0
It returns whether the given byte is a possible lead byte for the specified script.
[more]virtual bool16 IsPossibleSecondByte(uchar charByte, int8 script) = 0
It returns whether the given byte is a possible trailing (second) byte for the specified script.
[more]virtual void JIS2Kuten(textchar &ch) = 0
Converts a JIS encoded textchar to its equivalent Kuten code encoding.
[more]virtual void JIS2ShiftJIS(textchar &ch) = 0
Converts a JIS encoded textchar to its equivalent Shift-JIS encoding.
[more]virtual void Kuten2JIS(textchar &ch) = 0
Converts a Kuten code encoded textchar to its equivalent JIS encoding.
[more]virtual encodingType PopupIndexToEncodingType(int32 popupIndex) = 0
It returns an encodingType that corresponds to the index of a popup item that lists encoding types.
[more]virtual void ShiftJIS2JIS(textchar &ch) = 0
Converts a Shift-JIS encoded textchar to its equivalent JIS encoding.
[more]virtual textchar ShiftJIS2JIS(PlatformChar ch) = 0
Converts a Shift-JIS encoded PlatformChar to its equivalent JIS encoding.
[more]virtual void ShiftJIS2Unicode(textchar &ch) = 0
Converts a Shift-JIS encoded textchar to its equivalent unicode encoding.
[more]virtual textchar ShiftJIS2Unicode(PlatformChar ch) = 0
Converts a Shift-JIS encoded PlatformChar to its equivalent unicode encoding.
[more]virtual textchar StringToCharacterCode(PMString& str, encodingType encoding) = 0
It returns a textchar representation of the given string in the specifies encoding.
[more]virtual void Unicode2ShiftJIS(textchar &ch) = 0
Converts a unicode encoded textchar to its equivalent Shift-JIS encoding.
[more]virtual void unicode2DoubleByteEncoding( textchar &ch, uint8 script = -1 ) = 0
It converts a unicode textchar to its equivalent double byte encoding based on the script.

[more]enum
[more]enum encodingType
Used to enumerate Japanese encoding types for the popup menus


Documentation

It serves as a helper class that facilitates the conversion of multi-byte characters across various encoding standards. This class currently only supports the following encodings: JIS, Kuten-code, Shift-JIS, Unicode. Please use it via the UtilsBoss, such as: Utils<IEncodingUtils>()->Unicode2ShiftJIS( ch );
oenum

o kDefaultIID

ovirtual void Unicode2ShiftJIS(textchar &ch) = 0
Converts a unicode encoded textchar to its equivalent Shift-JIS encoding. This method converts the textchar in place.
Parameters:
ch - specifies the textchar to convert, and also stores the converted textchar.

ovirtual void ShiftJIS2Unicode(textchar &ch) = 0
Converts a Shift-JIS encoded textchar to its equivalent unicode encoding. This method converts the textchar in place.
Parameters:
ch - specifies the techchar to convert, and also stores the converted textchar.

ovirtual void ShiftJIS2JIS(textchar &ch) = 0
Converts a Shift-JIS encoded textchar to its equivalent JIS encoding. This method converts the textchar in place.
Parameters:
ch - specifies the textchar to convert, and also stores the converted textchar.

ovirtual void JIS2ShiftJIS(textchar &ch) = 0
Converts a JIS encoded textchar to its equivalent Shift-JIS encoding. This method converts the textchar in place.
Parameters:
ch - specifies the textchar to convert, and also stores the convertes textchar.

ovirtual void JIS2Kuten(textchar &ch) = 0
Converts a JIS encoded textchar to its equivalent Kuten code encoding. This method converts the textchar in place.
Parameters:
ch - specifies the textchar to convert, and also stores the convertes textchar.

ovirtual void Kuten2JIS(textchar &ch) = 0
Converts a Kuten code encoded textchar to its equivalent JIS encoding. This method converts the textchar in place.
Parameters:
ch - specifies the textchar to convert, and also stores the convertes textchar.

ovirtual textchar ShiftJIS2Unicode(PlatformChar ch) = 0
Converts a Shift-JIS encoded PlatformChar to its equivalent unicode encoding.
Parameters:
ch - the PlatformChar to be converted
Returns:
the converted textchar

ovirtual textchar ShiftJIS2JIS(PlatformChar ch) = 0
Converts a Shift-JIS encoded PlatformChar to its equivalent JIS encoding.
Parameters:
ch - the PlatformChar to be converted
Returns:
the converted textchar

oenum encodingType
Used to enumerate Japanese encoding types for the popup menus

o kCharInput

o kShiftJIS

o kJIS

o kKuten

o kUnicode

ovirtual encodingType PopupIndexToEncodingType(int32 popupIndex) = 0
It returns an encodingType that corresponds to the index of a popup item that lists encoding types. Use this method if you have a popup with the following Entries: Character Input, Separator, Shift JIS, JIS, Kuten, Unicode. This is used for various user interfaces where Japanese double-byte strings can be specified in any of the encoding types.
Parameters:
popupIndex - specifies the index number of the popup menu
Returns:
the encoding type for the index

ovirtual textchar StringToCharacterCode(PMString& str, encodingType encoding) = 0
It returns a textchar representation of the given string in the specifies encoding. If an invalid encodingType is specified, this method will return 0, and cause an assert in debug mode.
Parameters:
str - the string to convert
encoding - specifies the encoding for the given string
Returns:
the converted textchar

ovirtual PMString CharacterCodeToString(textchar code, encodingType encoding) = 0
It returns a PMString representing the given textchar in the given encoding. The returned PMString is marked "not to be translated". If an invalid encodingType is specified, this method will return 0, and cause an assert in debug mode.
Parameters:
code - the textchar to be converted
encoding - specifies the encoding for the given textchar

ovirtual textchar GetHexCode(PMString& s) = 0
It extracts the hexadecimal value from up to the first 4 bytes of the given PMString representing a hexadecimal code, and returns it as a textchar.
Parameters:
s - specifies the string to convert to hexadecimal value
Returns:
the hexadecimal value in textchar. If the string has more than 4 bytes or does not contain any valid hexadecimal characters, it returns 0.

ovirtual textchar GetKutenCode(PMString& s) = 0
It extracts the Kuten code value from up to the first 5 bytes of the given PMString representing a decimal Kuten code, and returns it as a textchar.
Parameters:
s - specifies the string to convert to Kuten code value
Returns:
the Kuten code value in textchar. If the string has more than 5 bytes or does not contain any valid decimal characters, it returns 0.

ovirtual bool16 IsHex(uchar c) = 0
It returns whether or not the given character is a hexadecimal character ('0'-'9', 'A'-'F' or 'a'-'f')

ovirtual bool16 IsDecimal(uchar c) = 0
It returns whether or not the given character is a decimal character ('0'- '9')

ovirtual int32 IntValue(uchar c) = 0
It returns the integer value of a hexadecimal character

ovirtual void DoubleByteEncoding2unicode( textchar &ch, uint8 script = -1 ) = 0
It converts a double byte textchar to its equivalent unicode encoding based on the script. This method converts the textchar in place.
Parameters:
ch - specifies the textchar to convert, and also stores the converted textchar. If you specify an invalid textchar for the script, it returns 0 for the textchar.

ovirtual bool16 DoubleByteIsValidUnicode(const textchar &inChar, uint8 script = -1 ) = 0
It checks if the textchar is defined in UNICODE

ovirtual void unicode2DoubleByteEncoding( textchar &ch, uint8 script = -1 ) = 0
It converts a unicode textchar to its equivalent double byte encoding based on the script. This method converts the textchar in place.
Parameters:
ch - specifies the textchar to convert, and also stores the converted textchar. If you specify an invalid textchar for the script, it returns 0 for the textchar.

ovirtual textchar FontBasedPlatformEncoding2Unicode( PlatformChar platformChar, IPMFont* transFont ) = 0

ovirtual PlatformChar FontBasedUnicode2PlatformEncoding( textchar unicodeChar, IPMFont* transFont, uint8 script = -1 ) = 0

ovirtual bool16 IsPossibleLeadByte(uchar charByte, int8 script) = 0
It returns whether the given byte is a possible lead byte for the specified script. This is useful for parsing double byte text.

ovirtual bool16 IsPossibleSecondByte(uchar charByte, int8 script) = 0
It returns whether the given byte is a possible trailing (second) byte for the specified script. On the Windows platform, this method only works for Japanese. This is useful for parsing double byte text.

ovirtual bool16 IsDoubleByteScript(int8 script) = 0


Aggregated on:

kUtilsBoss

Alphabetic index