[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: HOWTO: Deal properly with internationalisation in Qt 2 and KDE 2 code
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-11-29 23:42:46
[Download RAW message or body]

On Wednesday 29 November 2000 22:41, Hans Meine wrote:
> >     1. Right-fashion-localized system must permit to use of national characters
> >        everythere, incl. filenames etc.
> Are there standards how programs can determine what charset an ext2 filesystem
> uses? (Linux)
> 
> I got a directory named:
> 
>   "rinôçéròse" (hope this comes trough.. ;-) )

It does for me... So this is latin1, right ?

Wow, this is really strange. I copied and pasted it (no french keyboard at hand),
and if I use it in "mkdir", then indeed it works in the shell but not in konsole.
However if I paste it in konqueror as the name of a new folder, then the folder 
works fine in konq. Which proves they indeed use a different encoding :(

Konq (kio_file) uses QFile::encodeName for files, so for sure it uses latin1
for me (LANG=en LC_CTYPE=en_GB).

The string above, though, seems to be UTF8. It appears in konqueror like
UTF-8 appears when being read "as is" (in latin1).
I'm pasting it here, but I don't know how it will render for others : rinôçéròse

> KHTML tests:
>   just "ls|head -n1>test.html" displays "rinOOOrOse", same with
>   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
>   in a <head>. KHTML seems to do fine -> font problem? (see lower)
No, I think this is NOT latin1.... Try utf-8 ?

AH ! I know !
Konsole or Xterm makes a HUGE difference here !!!

If I paste your string into an xterm, then it becomes evident it's UTF8. So 
basically it does NOT work there. It "appears" to work in konsole because 
konsole (Qt in fact) auto-detects UTF 8 and displays it correctly.
On the other hand, it doesn't print correctly the output of ls (latin1 
accentuated chars get mangled into '?').

Conclusion: I think konsole is a bit broken. I have "Codec = locale" in
its options, but it seems to be in fact set to UTF 8.

Other conclusions: the file system is in locale8bit, as Qt expects. If you 
create the directory from xterm or from konqueror, they will interoperate
just fine.

PS: Maybe I get utf8 out of the string above, but this could be due to 
the mail exchange. Maybe for you the directory is actually encoded
in some other encoding :)

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://www.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today
See http://www.kde.org/kde1-and-kde2.html for how to set up KDE 2

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic