diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-04-09 13:24:30 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-04-09 13:24:30 +0000 |
commit | 90de85d9f5905f92507b78f32a43e354a6181e2f (patch) | |
tree | 2d73135f408525b979b0ff37754dc41c339c4e21 | |
parent | b9d6263e1d1806a04ee58648c95db915e6cc0ad2 (diff) | |
download | drakx-backup-do-not-use-90de85d9f5905f92507b78f32a43e354a6181e2f.tar drakx-backup-do-not-use-90de85d9f5905f92507b78f32a43e354a6181e2f.tar.gz drakx-backup-do-not-use-90de85d9f5905f92507b78f32a43e354a6181e2f.tar.bz2 drakx-backup-do-not-use-90de85d9f5905f92507b78f32a43e354a6181e2f.tar.xz drakx-backup-do-not-use-90de85d9f5905f92507b78f32a43e354a6181e2f.zip |
create to_utf8 from po strings, use it for kdm message
-rw-r--r-- | perl-install/any.pm | 2 | ||||
-rw-r--r-- | perl-install/c/stuff.xs.pm | 25 | ||||
-rw-r--r-- | perl-install/install_steps.pm | 2 |
3 files changed, 27 insertions, 2 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index 42d7f4283..001ff08aa 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -796,4 +796,6 @@ sub runlevel { } } +sub to_utf8 { c::to_utf8($lang::charset || 'ISO_8859-1', $_[0]) } + 1; diff --git a/perl-install/c/stuff.xs.pm b/perl-install/c/stuff.xs.pm index 12d4c28a4..3fa08bc0a 100644 --- a/perl-install/c/stuff.xs.pm +++ b/perl-install/c/stuff.xs.pm @@ -455,7 +455,30 @@ from_utf8(s) char *buf = alloca(s_len + 10); /* 10 for safety, it should not be needed, utf8 is *always* bigger than a special encoding */ { char *ptr = buf; - int ptr_len = s_len; + int ptr_len = s_len + 10; + if ((iconv(cd, &s, &s_len, &ptr, &ptr_len)) != (size_t) (-1)) { + *ptr = 0; + RETVAL = buf; + } + } + iconv_close(cd); + } + OUTPUT: + RETVAL + +char * +to_utf8(charset, s) + char *charset + char *s + CODE: + iconv_t cd = iconv_open("utf-8", charset); + RETVAL = s; + if (cd != (iconv_t) (-1)) { + int s_len = strlen(RETVAL); + char *buf = alloca(2 * s_len + 10); /* 10 for safety, it should not be needed */ + { + char *ptr = buf; + int ptr_len = 2 * s_len + 10; if ((iconv(cd, &s, &s_len, &ptr, &ptr_len)) != (size_t) (-1)) { *ptr = 0; RETVAL = buf; diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index d9ef8c497..83dbf3d61 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -447,7 +447,7 @@ Consoles 1,3,4,7 may also contain interesting information"; # log::l("updating kde icons according to available devices"); # install_any::kdeicons_postinstall($o->{prefix}); - my $welcome = _("Welcome to %s", "HOSTNAME"); + my $welcome = any::to_utf8(_("Welcome to %s", "HOSTNAME")); substInFile { s/^(GreetString)=.*/$1=$welcome/ } "$o->{prefix}/usr/share/config/kdmrc"; install_any::disable_user_view($o->{prefix}) if $o->{security} >= 3 || $o->{authentication}{NIS}; run_program::rooted($o->{prefix}, "kdeDesktopCleanup"); |