summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-09-09 09:23:42 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-09-09 09:23:42 +0000
commitd499b0c47f696f041a6884ad2074d7a83c54e89f (patch)
treeb2d07b4db07778de170257bdf6f5a481f07a04fb
parent83d9861aefb8afa3c1c1e08695e6df36160bf732 (diff)
downloaddrakx-d499b0c47f696f041a6884ad2074d7a83c54e89f.tar
drakx-d499b0c47f696f041a6884ad2074d7a83c54e89f.tar.gz
drakx-d499b0c47f696f041a6884ad2074d7a83c54e89f.tar.bz2
drakx-d499b0c47f696f041a6884ad2074d7a83c54e89f.tar.xz
drakx-d499b0c47f696f041a6884ad2074d7a83c54e89f.zip
simplify ENC setting
-rw-r--r--perl-install/lang.pm48
1 files changed, 12 insertions, 36 deletions
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index af6e95876..b4d7746d0 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -584,43 +584,16 @@ sub get_ims() { keys %IM_config }
# Locale configuration regarding encoding/IM
#- ENC is used by some versions or rxvt
+my %locale2encoding = (
+ 'ja_JP' => 'eucj',
+ 'ko_KR' => 'kr',
+ 'zh_CN' => 'gb',
+ 'zh_HK' => 'big5',
+ 'zh_SG' => 'gb',
+ 'zh_TW' => 'big5',
+ );
+
my %IM_locale_specific_config = (
- 'ja_JP' => {
- ENC => 'eucj',
- },
- 'ja_JP.UTF-8' => {
- ENC => 'utf8',
- },
- 'ko_KR' => {
- ENC => 'kr',
- },
- 'ko_KR.UTF-8' => {
- ENC => 'utf8',
- },
- 'zh_TW' => {
- ENC => 'big5',
- },
- 'zh_TW.UTF-8' => {
- ENC => 'utf8',
- },
- 'zh_CN' => {
- ENC => 'gb',
- },
- 'zh_CN.UTF-8' => {
- ENC => 'utf8',
- },
- 'zh_HK' => {
- ENC => 'big5',
- },
- 'zh_HK.UTF-8' => {
- ENC => 'utf8',
- },
- 'zh_SG' => {
- ENC => 'gb',
- },
- 'zh_SG.UTF-8' => {
- ENC => 'utf8',
- },
#-XFree86 has an internal XIM for Thai that enables syntax checking etc.
#-'Passthroug' is no check at all, 'BasicCheck' accepts bad sequences
#-and convert them to right ones, 'Strict' refuses bad sequences
@@ -1049,6 +1022,9 @@ sub write {
delete @$h{qw(GTK_IM_MODULE QT_IM_MODULE XIM XIM_PROGRAM XMODIFIERS)};
add2hash($h, { XIM_PROGRAM => $IM_XIM_program{$im}{$h->{LC_NAME}} });
add2hash($h, $IM_locale_specific_config{$locale->{lang}});
+ $h->{ENC} = $locale2encoding{$locale->{lang}};
+ $h->{ENC} = 'utf8' if member($locale->{lang}, qw(ja_JP.UTF-8 ko_KR.UTF-8 zh_CN.UTF-8 zh_HK.UTF-8 zh_SG.UTF-8 zh_TW.UTF-8));
+
add2hash($h, $IM_config{$locale->{IM}});
$h->{QT_IM_MODULE} = $h->{GTK_IM_MODULE} if $h->{GTK_IM_MODULE};
my @packages = IM2packages($locale);