24.05.2014 Views

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

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.

• __mblen_std() - For all other code sets, use the __mbtowc_std()<br />

method to determine the number of bytes in the character by calling<br />

the appropriate iconv() converter and seeing how many bytes were<br />

able to be converted.<br />

mbstopcs() Convert multi-byte string to process code string. This function is<br />

somewhat obsolete, as mbstowcs() is the preferred alternative.<br />

There is one standard locale method, __mbstopcs_std(), which<br />

loops through the multi-byte string calling mbtopc() to convert each<br />

multi-byte character to the appropriate process code.<br />

mbstowcs() Convert multi-byte string to wide character string. There is one<br />

standard locale method, __mbstowcs_std(), which loops through<br />

the multi-byte string calling mbtowc() to convert each multi-byte<br />

character to the appropriate wide character.<br />

mbtopc()<br />

Convert multi-byte character to process code. This function is<br />

somewhat obsolete, as its function is duplicated by the mbtowc()<br />

function. There is one standard locale method, __mbtopc_std(),<br />

which calls mbtowc() to perform the intended function of converting<br />

the multi-byte character to process code (wide character).<br />

mbtowc() Convert multi-byte character to wide character. All of the provided<br />

mbtowc() methods convert the multi-byte character to a Unicode<br />

value. There are three different methods provided in order to<br />

optimize performance of this operation based on the nature of the<br />

multi-byte codeset:<br />

• __mbtowc_iso1() - Since ISO8859-1 is a proper subset of Unicode.<br />

Its data can be converted to Unicode by simply casting its 8-bit<br />

value to a 16-bit value. This is the fastest method for converting<br />

ISO8859-1 to Unicode.<br />

• __mbtowc_utf() - UTF-8-based data can be converted to Unicode<br />

by using a simple bit-shifting algorithm. This method should be<br />

used for all UTF-8 based locales since it is faster than the<br />

__mbtowc_std() method listed below.<br />

• __mbtowc_std() - For all other codesets, the __mbtowc_std()<br />

method converts the multi-byte data to Unicode using the iconv()<br />

interface. The conversion descriptor is defined as a static pointer so<br />

that multiple calls to __mbtowc_std() will not incur the overhead of<br />

multiple iconv_open() calls. Because this locale method is<br />

dependent on libiconv, it has been placed into a common locale<br />

method object in /usr/lib/nls/loc/methods/stdmeth.o instead of in the<br />

libc library, to avoid creating an unnecessary dependency between<br />

libc and libiconv.<br />

pcstombs() This method is obsolete since its function has been replaced by the<br />

method wcstombs(). Currently, this function just returns -1.<br />

pctomb()<br />

This method is obsolete since its function has been replaced by the<br />

method wctomb(). Currently, this function just returns -1.<br />

wcstombs() Convert wide character string to multi-byte string. There is one<br />

standard locale method __wcstombs_std(), which loops through the<br />

wide character string calling wctomb() to convert each wide<br />

character to the appropriate multi-byte string.<br />

246 <strong>AIX</strong> <strong>Version</strong> <strong>4.3</strong> <strong>Differences</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!