LayerAS_Layer
ObjectString_Encoding

Host encoding object.



Typedef Summary
 Typedef
 ASHostEncoding (Macintosh, Windows)
An integer specifying the host encoding for text. On Mac OS, it is a script code. On Windows, it is a CHARSET id. In UNIX, Acrobat currently only supports English, so the only valid ASHostEncoding is 0 (Roman). See ASScript.
 ASHostEncoding (UNIX)
An integer specifying the host encoding for text. On Mac OS, it is a script code. On Windows, it is a CHARSET id. In UNIX, Acrobat currently only supports English, so the only valid ASHostEncoding is 0 (Roman). See ASScript.
Enumeration Summary
 Enumeration
  ASScript
An enumeration of writing scripts. Not all of these scripts are supported on all platforms.
Method Summary
 Method
 
ASInt32 ASHostMBLen(ASHostEncoding encoding, ASUns8 byte)
Determines whether the given byte is a lead byte of a multi-byte character, and how many tail bytes follow.
 
ASBool ASIsValidUTF8(const ASUns8* cIn, ASCount cInLen)
Tests whether the bytes in the string conform to the Unicode UTF-8 encoding form. The method does not test whether the string is NULL-terminated.
 
Converts from a host encoding type to an ASScript value. On Windows, the host encoding is a CHARSET id. On Mac OS, the host encoding is a script code.
 
ASHostEncoding ASScriptToHostEncoding(ASScript asScript)
Converts from an ASScript code to a host encoding type. On Windows, the host encoding is a CHARSET id. On Mac OS, the host encoding is a script code.

Typedefs Detail
ASHostEncoding 
Product availability: Acrobat, Reader, PDFL
Platform availability: Macintosh, Windows

Syntax

typedef ASInt32 ASHostEncoding;

An integer specifying the host encoding for text. On Mac OS, it is a script code. On Windows, it is a CHARSET id. In UNIX, Acrobat currently only supports English, so the only valid ASHostEncoding is 0 (Roman). See ASScript.


File: ASExpT.h
Line: 3872
ASHostEncoding 
Product availability: Acrobat, Reader, PDFL
Platform availability: UNIX

Syntax

typedef struct _t_ASHostEncoding* ASHostEncoding;

An integer specifying the host encoding for text. On Mac OS, it is a script code. On Windows, it is a CHARSET id. In UNIX, Acrobat currently only supports English, so the only valid ASHostEncoding is 0 (Roman). See ASScript.


File: ASExpT.h
Line: 3870

Enumeration Detail
ASScript
Product availability: All
Platform availability: All

Syntax


File: ASExpT.h
Line: 3902

Elements
kASRomanScript  

Roman.

 
kASJapaneseScript  

Japanese.

 
kASTraditionalChineseScript  

Traditional Chinese.

 
kASKoreanScript  

Korean.

 
kASArabicScript  

Arabic.

 
kASHebrewScript  

Hebrew.

 
kASGreekScript  

Greek.

 
kASCyrillicScript  

Cyrillic.

 
kASRightLeftScript  

RightLeft.

 
kASDevanagariScript  

Devanagari.

 
kASGurmukhiScript  

Gurmukhi.

 
kASGujaratiScript  

Gujarati.

 
kASOriyaScript  

Oriya.

 
kASBengaliScript  

Bengali.

 
kASTamilScript  

Tamil.

 
kASTeluguScript  

Telugu.

 
kASKannadaScript  

Kannada.

 
kASMalayalamScript  

Malayalam.

 
kASSinhaleseScript  

Sinhalese.

 
kASBurmeseScript  

Burmese.

 
kASKhmerScript  

Khmer

 
kASThaiScript  

Thai

 
kASLaotianScript  

Laotian.

 
kASGeorgianScript  

Georgian.

 
kASArmenianScript  

Armenian.

 
kASSimplifiedChineseScript  

Simplified Chinese.

 
kASTibetanScript  

Tibetan.

 
kASMongolianScript  

Mongolian.

 
kASGeezScript  

Ge'ez.

 
kASEastEuropeanRomanScript  

East European Roman.

 
kASVietnameseScript  

Vietnamese.

 
kASExtendedArabicScript  

Extended Arabic.

 
kASEUnicodeScript  

Unicode.

 
kASDontKnowScript  

Unknown.



Method Detail
ASHostMBLen()
Product availability: All
Platform availability: All

Syntax

ASInt32 ASHostMBLen(ASHostEncoding encoding, ASUns8 byte)

Determines whether the given byte is a lead byte of a multi-byte character, and how many tail bytes follow.

When parsing a string in a host encoding, you must keep in mind that the string could be in a variable length multi-byte encoding. In such an encoding (for example, Shift-JIS) the number of bytes required to represent a character varies on a character-by-character basis. To parse such a string you must start at the beginning and, for each byte, determine whether that byte represents a character or is the first byte of a multi-byte character. If the byte is a lead byte for a multi-byte character, you must also compute how many bytes will follow the lead byte to make up the entire character. Currently the API provides a call (PDHostMBLen()) that performs these computations, but only if the encoding in question is the operating system encoding (as returned by PDGetHostEncoding()). ASHostMBLen() allows you to determine this for any byte in any host encoding.

Parameters

encoding — 

The host encoding type.

 
byte — 

The first byte of a multi-byte character.

Returns

The number of additional bytes required to form the character. For example, if the encoding is a double-byte encoding, the return value will be 1 for a two-byte character and 0 for a one-byte character. For Roman encodings, the return value will always be 0.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00050000

File: ASProcs.h
Line: 2019
ASIsValidUTF8() 
Product availability: All
Platform availability: All

Syntax

ASBool ASIsValidUTF8(const ASUns8* cIn, ASCount cInLen)

Tests whether the bytes in the string conform to the Unicode UTF-8 encoding form. The method does not test whether the string is NULL-terminated.

Parameters

cIn — 

The string.

 
cInLen — 

The length of the string in bytes, not including the NULL byte at the end.

Returns

true if the bytes in the string conform to the Unicode UTF-8 encoding form, false otherwise.

Since

PI_ASEXTRA_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 2330
ASScriptFromHostEncoding() 
Product availability: All
Platform availability: All

Syntax

ASScript ASScriptFromHostEncoding(ASHostEncoding osScript)

Converts from a host encoding type to an ASScript value. On Windows, the host encoding is a CHARSET id. On Mac OS, the host encoding is a script code.

Parameters

osScript — 

The host encoding type.

Returns

The new ASScript value.

See Also

Since

PI_ASEXTRA_VERSION >= 0x00050000

File: ASExtraProcs.h
Line: 57
ASScriptToHostEncoding() 
Product availability: All
Platform availability: All

Syntax

ASHostEncoding ASScriptToHostEncoding(ASScript asScript)

Converts from an ASScript code to a host encoding type. On Windows, the host encoding is a CHARSET id. On Mac OS, the host encoding is a script code.

Parameters

asScript — 

The script value.

Returns

The new host encoding type.

See Also

Since

PI_ASEXTRA_VERSION >= 0x00050000

File: ASExtraProcs.h
Line: 46