Adobe.com
Contents Suites Classes Class Index Member Index

AICharacterEncodingSuite Struct Reference
[API Suite List]

The character encoding suite provides facilities for translating between different encodings of textual data. More...

#include <AICharacterEncoding.h>

List of all members.

Public Attributes

AIAPI AIErr(* ConvertBuffer )(const void *srcBuffer, size_t srcBytes, AICharacterEncoding srcEncoding, void *dstBuffer, size_t dstBytes, AICharacterEncoding dstEncoding, size_t *dstLength, AIBoolean errIfCantMap)
 Converts text from one encoding to another.
AIAPI AIErr(* ConvertJapaneseChar )(AIJapaneseEncoding srcEncoding, AIJapaneseEncoding dstEncoding, ai::uint16 *ch)
 Converts a Japanese character from one Japanese encoding to another.
AIAPI AIBool8(* IsPunct )(ASUnicode inChar)
 Reports whether a given Unicode (UTF16) character is categorized as a punctuation character.
AIAPI AIBool8(* IsSpace )(ASUnicode inChar)
 Reports whether a given Unicode (UTF16) character is categorized as a spacing character.
AIAPI AIErr(* GetCheckedPreferredEncoding )(const ASUnicode *inUnicodeText, AICharacterEncoding inDefaultEncoding, AICharacterEncoding *outMBCSEncoding)
 Finds the preferred encoding for a given Unicode String.

Detailed Description

The character encoding suite provides facilities for translating between different encodings of textual data.

See also ai::EncodedString, which provides a C++ class for translating between platform encoding, UTF8, and UTF16.


Member Data Documentation

AIAPI AIErr(* AICharacterEncodingSuite::ConvertBuffer)(const void *srcBuffer, size_t srcBytes, AICharacterEncoding srcEncoding, void *dstBuffer, size_t dstBytes, AICharacterEncoding dstEncoding, size_t *dstLength, AIBoolean errIfCantMap)

Converts text from one encoding to another.

Unicode 3 values are always used as the intermediate representation during the translation between the source and the destination encodings. Byte order of UTF16 Unicode values are dictated by the current platform (big-endian in Mac OS, little-endian in Windows).

If some characters do not map exactly, a loose or fallback mapping is used. If some characters cannot be mapped, the source characters are dropped from the destination buffer.

Parameters:
srcBuffer The buffer containing the text.
srcBytes The number of bytes in srcBuffer.
srcEncoding The encoding used by the text in srcBuffer.
dstBuffer [out] A buffer in which to return the converted text.
dstBytes The number of bytes in dstBuffer.
dstEncoding The encoding to which to convert the text.
dstLength [out] A buffer in which to return the number of bytes written to dstBuffer.
errIfCantMap When true, return error codes when characters do not map exactly.

Referenced by ai::EncodedString< Traits >::cast().

Converts a Japanese character from one Japanese encoding to another.

Parameters:
srcEncoding The encoding currently used for ch.
dstEncoding The encoding to which to convert the character.
ch [in, out] A pointer to the Japanese character, represented as an unsigned short.
Returns:
The error kBadParameterErr if ch is not within a valid range for srcEncoding.
The error kBadParameterErr if ch is a single-byte Shift-JIS character (used to represent ASCII and half-width katakana characters). Such characters cannot be converted to JIS X 0208 or Kuten.
AIAPI AIErr(* AICharacterEncodingSuite::GetCheckedPreferredEncoding)(const ASUnicode *inUnicodeText, AICharacterEncoding inDefaultEncoding, AICharacterEncoding *outMBCSEncoding)

Finds the preferred encoding for a given Unicode String.

Parameters:
inUnicodeText The Unicode String.
inDefaultEncoding The default encoding
outMBCSEncoding [out] A buffer in which to return the most suitable encoding.

Reports whether a given Unicode (UTF16) character is categorized as a punctuation character.

Only supports characters in the BMP (Basic Multilingual Plane). (Note that this function returns a Boolean value, not an error code)

Parameters:
inChar The character.
Returns:
True if the character is punctuation.

Reports whether a given Unicode (UTF16) character is categorized as a spacing character.

Only supports characters in the BMP (Basic Multilingual Plane). (Note that this function returns a Boolean value, not an error code)

Parameters:
inChar The character.
Returns:
True if the character is spacing.

The documentation for this struct was generated from the following file:


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2014 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks