Chapter 13. Examples of I18N
107
} else {
$KANJI=0;
}
}
$KANJI;
}
&sourceset2displayset($)
is a function to convert a string from codeset for source code into
codeset for display. This is needed because codeset for program source (in this case, perl script)
and dotfiles may be different.
4
The following function is prepared to display messages in appropriate codeset. Don't care '
Lang::
'
package.
sub disp ($$) {
if ($NC) {print STDERR &Lang::sourceset2displayset($_[1]);}
else {print STDERR $_[0];}
}
This is an example how the
disp
function is used.
sub disp_finish()
{
&Sub::disp(<
[Enter] key WO OSUTO KONO user ja conf HA SYUURYOU SHIMASU.
EOF1
Japanese sentence in Japanese characters 'Push [Enter] key to finish.'
EOF2
}
Here the sentence '[Enter] key WO OSUTO. . . ' is the Latin alphabet expression of Japanese.
Thus almost all messages are duplicated using
disp
function.
4
There are three popular codesets for Japanese   ISO 2022 JP, EUC JP, and SHIFT JIS. EUC JP should be used for
perl source code because all non ASCII characters in EUC JP do not have values in 0x21   0x7e. However, ISO 2022 JP
is the safest codeset to display because EUC JP and SHIFT JIS have to be used exclusively. However, ISO 2022 JP is the
most difficult codeset to implement and there may be a terminal environment which does not understand ISO 2022 JP
(for example, Minicom). On the other hand, dotfiles may be written in any codesets, according to one's favorite and
purpose.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

indiana web hosting

 

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