HP 9000 User Manual page 89

Computers
Hide thumbs Also See for 9000:
Table of Contents

Advertisement

Programming with the Worldwide Portability Interface
One objective of international program design is to create an application that is
codeset independent. The Worldwide Portability Interface (WPI) automatically
converts data to/from its internal coding to/from wide characters, which keeps
the programmer from having to know anything about wide character sets.
For some applications, character processing may be more convenient
if multi-byte characters are represented as constant width characters-
so-called wide characters. (For more information on multi-byte characters see
Appendix A.)
For such situations, a set of routines is available to convert between multi-byte
characters and wide characters. The wide character representation is more
convenient because it offers a single data type for all languages.
WPllnterfaces
Use the following steps to internationalize an existing program with the WPI
In terfaces:
6
1. Convert char data types to wchar _ t.
2. Where parallel routines exist, change calls to the WPI versions.
Instead of this
Use this
strcmp
wcscmp
isdigit
iswdigit
fgetc
fgetwc
3. In cases where no parallel routine exists, you need to add code to convert
wide character data to multibyte, using wcstombs, for example. Then pass
multibyte data to "standard" routines.
6·12
Developing International Software

Advertisement

Table of Contents
loading

Table of Contents