75
Chapter 9
Internal Processing and File I/O
There are many text processing softwares, such as
grep
,
groff
,
head
,
sort
,
wc
,
uniq
,
nl
,
expand
, and so on. There are also many script languages which are often used for text processing,
such as
sed
,
awk
,
perl
,
python
,
ruby
, and so on. These softwares need to be internationalized.
From a user's point of view, a software can use any internal encodings if I/O is done correctly. It
is because a user cannot be aware of which kind of internal code is used in the software.
There are two candidate for internal encoding. One is wide character and the another is UCS 4.
You can also use Mule type encoding, where a pair of a number to express CCS and a number to
express a character consist a unit.
I recommend to use wide character, for reasons I alread explained in `LOCALE technology' on
page
53
, i.e., wide character can be encoding independent and can support various encodings in
the world including UTF 8, can supply a common united way for users to choose encodings, and
so on.
Here a few examples of handling of
wchar_t
are shown.
9.1 Stream I/O of Characters
The following program is a small example of stream I/O of wide characters.
#include
#include
#include
main()
{
wint_t c;
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved