ASCII extended characters won't be written/coded properly :o(((
Shot - Piotr Szotkowski
shot at hot.pl
Sat Sep 10 13:05:07 UTC 2005
Hello.
Vincent Trouilliez:
> the accented character, 'é', is normally extended ASCII code 0x82.
Nope. é is 0xE9 in both ISO-8859-1 and ISO-8859-15. Your controller
most probably expects IBM437, as that's where é is encoded as 0x82.
> I looked at the source file using a binary editor, and realised that
> the 'é', supposedly 0x82, was actually coded as TWO bytes : "C3 A9" !
> That's using the default UTF-8 encoding.
That's because you're using a *.UTF-8 locale (and rightly so).
> I then thought of asking Gedit to save the source file using the old
> European encoding "Western ISO 8859-15". Using this encoding, Gedit
> coded the 'é' as "E9", a single byte at last, but still not correct !!
> So when the controller prints my strings to an ASCII terminal, I don't
> get the expected characters !
It's a problem with the terminal. You have to recode
the files from UTF-8 to IBM437, for example with
$ iconv -f UTF8 -t IBM437 -o recoded.file original.file
[1] http://en.wikipedia.org/wiki/ISO-8859-1
[2] http://en.wikipedia.org/wiki/ISO-8859-15
[3] http://en.wikipedia.org/wiki/IBM437
[4] http://en.wikipedia.org/wiki/Comparison_of_western_latin_character_sets
Cheers,
-- Shot
--
It is inaccurate to say I hate everything. I am strongly in favor
of common sense, common honesty, and common decency. This makes
me forever ineligible for public office. -- H. L. Mencken
====================== http://shot.pl/hovercraft/ === http://shot.pl/1/125/ ===
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050910/31faa4d1/attachment.sig>
More information about the ubuntu-users
mailing list