Le Lundi 20 Décembre 2004 02:33, [EMAIL PROTECTED] a écrit :
> I think the more proper solution is each translation file
> contains its encoding.
But it may be simpler for us to use UTF-8 as we don't have to ask contributors 
to give us there local encoding. Moreover, I didn't succeed in displaying 
polish characters in konsole (polish encoding is cp-1250). Using UTF8, I only 
have to switch font to "unicode" and it works.
note : I just discovered that "echo -ne '\033%@'" disable UTF-8.

===== current system =====
* example
nothing to do
* problems
- difficult for maintainers

===== 1st solution : switch the terminal to UTF-8 (manual) =====
* example
function doInUtf8 () { echo -ne '\033%G' ; $@ ; echo -ne '\033%@' ; }
doInUtf8 diff pl pl.old
* problems
- unicode doesn't work in aterm and rxvt
- if the terminal was already in UTF-8, this command disable it. I've tried 
the command "vt-is-UTF8" but it always return "Single-byte char mode."

===== 2nd solution : switch the terminal to UTF-8 (setcode) =====
* example
function echoWithEnc () { LC_CTYPE=UTF-8 setcode; $@ ; setcode ; }
* problems
- unicode doesn't work in aterm and rxvt
- licence of setcode is still unknown
- display annoying characters ("bC") when calling "setcode".
     [EMAIL PROTECTED] lang]$ setcode
     [EMAIL PROTECTED] lang]$

===== 3rd solution : convert strings to local encoding =====
* example
function doFromUtf8 () { $@ | iconv -fUTF-8 ; }
* problems
- is iconv available in all distribs?
- "--to-code" parameter is not marqued as optionnal in iconv man page (but it 
works)
- maybe it should never happened, but if a character is not available in 
target encoding, iconv quits returning "illegal input sequence at 
position..."


I'd like to use the first solution but it requires us to find how to detect 
whether the terminal is already in UTF-8.

_____
Tux

Attachment: pgp4feQe6lrXP.pgp
Description: PGP signature

Reply via email to