localize problem
localize problem
I'd ran Puppy 2.12
I'd used the Choselocale in Control Panel and set "locale to" en_US.UF-8 (I had the directory en_US.UTF-8 in two places: /usr/share/lib and /usr/share/locale.
When I use the command:
# locale
I met this message:
sh-3.00# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
sh-3.00#
What errors did I met?
What can I do now? Please explain it to me and give me some instructions.
Thank a lot
I'd used the Choselocale in Control Panel and set "locale to" en_US.UF-8 (I had the directory en_US.UTF-8 in two places: /usr/share/lib and /usr/share/locale.
When I use the command:
# locale
I met this message:
sh-3.00# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
sh-3.00#
What errors did I met?
What can I do now? Please explain it to me and give me some instructions.
Thank a lot
file (directory) en_US.UTF-8
You can download here
localize
To Ian,
Thank you to answer
I'd followed all instructions of Chooselocale program. You could see these snapshots
Thank you to answer
I'd followed all instructions of Chooselocale program. You could see these snapshots
- Attachments
-
- locale3.gif
- (25.91 KiB) Downloaded 874 times
-
- locale2.gif
- (14.79 KiB) Downloaded 868 times
-
- locale1.gif
- (19.99 KiB) Downloaded 882 times
maybe you need more files like the folder
/usr/lib/locale/UTF-8
Here is a tar.gz to unpack with xarchive.
extract somewhere, then copy to /usr/lib/locale/ what you need.
http://dotpups.de/tests/german-utf8-usr-lib-locale.tgz
contains:
I do have problems.
One is concerning rxvt, but I could solve that:
http://www.murga-linux.com/puppy/viewto ... rm&t=13302
the other one:
I use Icewm.
If I create a utf-file like test-äöüß.txt, and open it in leafpad, the titlebar cuts everything in the title after the first utf-character, so it displays only "test-"
/tmp/xerrs.log tells me:
Error converting string 'testäö--ü.txt' to UTF-8 from current locale: Invalid byte sequence in conversion input
Error converting string 'testöäääääää.txt' to UTF-8 from current locale: Invalid byte sequence in conversion input
Error converting string 'tät' to UTF-8 from current locale: Invalid byte sequence in conversion input
Error converting string '1111ä.txt' to UTF-8 from current locale: Invalid byte sequence in conversion input
Error converting string 'testäöü.txt' to UTF-8 from current locale: Invalid byte sequence in conversion input
Error converting string 'testäöü.txt' to UTF-8 from current locale: Invalid byte sequence in conversion input
Error converting string 'testäöü.txt' to UTF-8 from current locale: Invalid byte sequence in conversion input
Warning: Cannot convert string "nil2" to type FontStruct
I also tried icewm 1.2.29, same result.
It seems icewm tries to convert utf to utf, what creates "doubled" utf-sequences, which are illegal of course.
Mark
/usr/lib/locale/UTF-8
Here is a tar.gz to unpack with xarchive.
extract somewhere, then copy to /usr/lib/locale/ what you need.
http://dotpups.de/tests/german-utf8-usr-lib-locale.tgz
contains:
Code: Select all
sh-3.00# ls -1 locale
de
de_AT
de_AT.UTF-8
de_BE
de_BE.UTF-8
de_CH
de_CH.UTF-8
de_DE
de_DE@euro
de_DE.UTF-8
de_LU
de_LU.UTF-8
en_AU
en_US
en_US.UTF-8
ISO-8859-15
UTF-8
sh-3.00#
One is concerning rxvt, but I could solve that:
http://www.murga-linux.com/puppy/viewto ... rm&t=13302
the other one:
I use Icewm.
If I create a utf-file like test-äöüß.txt, and open it in leafpad, the titlebar cuts everything in the title after the first utf-character, so it displays only "test-"
/tmp/xerrs.log tells me:
Error converting string 'testäö--ü.txt' to UTF-8 from current locale: Invalid byte sequence in conversion input
Error converting string 'testöäääääää.txt' to UTF-8 from current locale: Invalid byte sequence in conversion input
Error converting string 'tät' to UTF-8 from current locale: Invalid byte sequence in conversion input
Error converting string '1111ä.txt' to UTF-8 from current locale: Invalid byte sequence in conversion input
Error converting string 'testäöü.txt' to UTF-8 from current locale: Invalid byte sequence in conversion input
Error converting string 'testäöü.txt' to UTF-8 from current locale: Invalid byte sequence in conversion input
Error converting string 'testäöü.txt' to UTF-8 from current locale: Invalid byte sequence in conversion input
Warning: Cannot convert string "nil2" to type FontStruct
I also tried icewm 1.2.29, same result.
It seems icewm tries to convert utf to utf, what creates "doubled" utf-sequences, which are illegal of course.
Mark
found solution for the icewm-titles I think.
If you use a UTF-8 locale, you need a icewm compiled with
--disable-i18n
I compiled it with
./configure --prefix=/usr/local --enable-gradients --enable-antialiasing --enable-guievents --with-icesound=OSS,Y,ESound --disable-i18n
Can upload a dotpup tomorrow.
Mark
If you use a UTF-8 locale, you need a icewm compiled with
--disable-i18n
I compiled it with
./configure --prefix=/usr/local --enable-gradients --enable-antialiasing --enable-guievents --with-icesound=OSS,Y,ESound --disable-i18n
Can upload a dotpup tomorrow.
Mark
do you mean like this?
http://i16.tinypic.com/33u4mpu.png
leafpad ... Icewm 1.2.29
./configure --build=i486 --enable-gradients --enable-antialiasing --enable-guievents --with-icesound=OSS,Y,ESound --with-imlib
http://i16.tinypic.com/33u4mpu.png
leafpad ... Icewm 1.2.29
./configure --build=i486 --enable-gradients --enable-antialiasing --enable-guievents --with-icesound=OSS,Y,ESound --with-imlib
does Icewm use iconv ? ... if it does, you could start iconv with a wrapper script to get the parameters ... something like this:
#!/bin/sh
echo "$@" >> /tmp/iconv.log
exec /usr/bin2/iconv "$@"
it might give you a clue to what is happening
there are compile config options for what version of utf Icewm uses internally ... for example, there are messages like these when running ./configure
checking whether iconv converts from UTF-8 to UCS-4//TRANSLIT... yes
checking whether iconv converts from ISO-8859-1 to UCS-4//TRANSLIT... yes
checking whether iconv converts from ISO-8859-2 to UCS-4//TRANSLIT... yes
checking whether iconv converts from UTF-8 to UCS-4//TRANSLIT... yes
#!/bin/sh
echo "$@" >> /tmp/iconv.log
exec /usr/bin2/iconv "$@"
it might give you a clue to what is happening
there are compile config options for what version of utf Icewm uses internally ... for example, there are messages like these when running ./configure
checking whether iconv converts from UTF-8 to UCS-4//TRANSLIT... yes
checking whether iconv converts from ISO-8859-1 to UCS-4//TRANSLIT... yes
checking whether iconv converts from ISO-8859-2 to UCS-4//TRANSLIT... yes
checking whether iconv converts from UTF-8 to UCS-4//TRANSLIT... yes
it uses a inbuild iconv function from libc (#include iconv.h).
It is called from
ylocale.cc, around line 148
You can add different utf-versions a bit before, line 80:
I just tried some other values reported by
iconv -l
but without success.
But I also think, it must be here.
However, I fear the problem is:
iconv seems not to be able, to convert utf to utf.
As a file saved with leafpad using a UTF-8 locale already has utf-characters in the filename, you get this error about illegal Multibyte-characters.
So I also tried to bypass the conversion, but also without success.
But this might be due to my lack in C++ knowledge, maybe I just wrote wrong code.
Also it would not be that simple.
As this function IS needed to read .desktop-files.
Without it, UTF-characters inside such files are displayed wrong.
So I also had tried to modify other places like wmclient.cc, but that confused me even more
Mark
It is called from
ylocale.cc, around line 148
Code: Select all
if (0 > (int) iconv(instance->toUnicode, &inbuf, &inlen, &outbuf, &outlen)){
warn(_("Invalid multibyte string \"%s\": %s"), lStr, strerror(errno));
}
Code: Select all
/// TODO #warning "this is getting way too complicated"
char const * unicodeCharsets[] = {
#ifdef CONFIG_UNICODE_SET
CONFIG_UNICODE_SET,
#endif
// "WCHAR_T//TRANSLIT",
(*endian.c ? "UCS-4LE//TRANSLIT" : "UCS-4BE//TRANSLIT"),
// "WCHAR_T",
(*endian.c ? "UCS-4LE" : "UCS-4BE"),
"UCS-4//TRANSLIT",
"UCS-4",
NULL
};
iconv -l
but without success.
But I also think, it must be here.
However, I fear the problem is:
iconv seems not to be able, to convert utf to utf.
As a file saved with leafpad using a UTF-8 locale already has utf-characters in the filename, you get this error about illegal Multibyte-characters.
So I also tried to bypass the conversion, but also without success.
But this might be due to my lack in C++ knowledge, maybe I just wrote wrong code.
Also it would not be that simple.
As this function IS needed to read .desktop-files.
Without it, UTF-characters inside such files are displayed wrong.
So I also had tried to modify other places like wmclient.cc, but that confused me even more
Mark
ok, the problem was determinating the SOURCE-codeset.
This is taken from the locale-settings.
To open .desktop-files, it must be xx_XX.UTF-8
To display filenames that include utf-characters in the titlebar, it must be codeset = "ISO-8859-1";
At least with german characters, I did not try vietnamese or arab.
My modified versions for ylocale.cc are here:
http://dotpups.de/tests/icewm-1.2.29-unicode/
I added a check:
if there is an error using UTF-8 (this multibyte-error), then it is tried again with "ISO-8859-1".
Now I have Umlaute in the menu AND the titlebars for files saved with leafpad using UTF-characters in the filename.
I also uploaded wmapp.c, where I commented the "restart xterm" menu-entry, as it just kills icewm, but not X.
I will try to upload Muppy006 tomorrow night.
Might not include everything I wanted for this release, but I hope I fixed most of the bugs, and Unicode should now work in most cases (Xfe not really, but can be used partially after another code-modification).
Default filemanager is rox 2.5.
I'm away this weekend, so I'd like to release it tomorrow already.
Mark
This is taken from the locale-settings.
To open .desktop-files, it must be xx_XX.UTF-8
To display filenames that include utf-characters in the titlebar, it must be codeset = "ISO-8859-1";
At least with german characters, I did not try vietnamese or arab.
My modified versions for ylocale.cc are here:
http://dotpups.de/tests/icewm-1.2.29-unicode/
I added a check:
if there is an error using UTF-8 (this multibyte-error), then it is tried again with "ISO-8859-1".
Now I have Umlaute in the menu AND the titlebars for files saved with leafpad using UTF-characters in the filename.
I also uploaded wmapp.c, where I commented the "restart xterm" menu-entry, as it just kills icewm, but not X.
I will try to upload Muppy006 tomorrow night.
Might not include everything I wanted for this release, but I hope I fixed most of the bugs, and Unicode should now work in most cases (Xfe not really, but can be used partially after another code-modification).
Default filemanager is rox 2.5.
I'm away this weekend, so I'd like to release it tomorrow already.
Mark