10.07.2015 Views

Download - Multivac!

Download - Multivac!

Download - Multivac!

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Non-Unicode CMaps for Chinese, Japanese, and Korean text (see Section 4.5, »Encodingsfor Chinese, Japanese, and Korean Text«, page 85) must be avoided since thewrapper will always supply Unicode to the PDFlib core; only Unicode CMaps can beused.The overall effect is that clients can provide plain Unicode strings to PDFlib functionswithout any additional configuration or parameter settings. The distinction betweenhypertext strings and name strings in the function descriptions is not relevant for Unicode-awarelanguage bindings.Unicode conversion functions. If you must deal with strings in other encodings thanUnicode, you must convert them to Unicode before passing them to PDFlib. The language-specificsections in Chapter 2, »PDFlib Language Bindings«, page 25, provide moredetails regarding useful Unicode string conversion methods provided by common languageenvironments.4.3.3 Strings in non-Unicode-aware Language BindingsThe following PDFlib language bindings are not Unicode-aware:> C (no native string data type available)> C++> Cobol (no native string data type available)> Perl> PHP> old-style Python binding for compatibility with PDFlib 6 (see Section 2.9, »PythonBinding«, page 39, for configuration information)> RubyIn language bindings which do not support a native string data type (i.e. C, Cobol) thelength of UTF-16 strings must be supplied in a separate length parameter. Although Unicodetext can be used in these languages, handling of the various string types is a bitmore complicated:Content strings. Content strings are strings used to create page content. Interpretationof these strings is controlled by the textformat parameter (detailed below) and theencoding parameter of PDF_load_font( ). If textformat=auto (which is the default) utf16format will be used for the unicode and glyphid encodings as well as UCS-2 and UTF-16CMaps. For all other encodings the format will be bytes. In languages without a nativestring data type (see list above) the length of UTF-16 strings must be supplied in a separatelength parameter.Hypertext strings. String interpretation is controlled by the hypertextformat andhypertextencoding parameters (detailed below). If hypertextformat=auto (which is the default)utf16 format will be used if hypertextencoding=unicode, and bytes otherwise. In languageswithout a native string data type (see list above) the length of UTF-16 stringsmust be supplied in a separate length parameter.Name strings. Name strings are interpreted slightly differently from page descriptionstrings. By default, name strings are interpreted in host encoding. However, if it startswith an UTF-8 BOM it will be interpreted as UTF-8 (or as EBCDIC UTF-8 if it starts with an4.3 Strings in PDFlib 77

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!