ASCII extended characters won't be written/coded properly :o(((

Lee Braiden lee_b at digitalunleashed.com
Sat Sep 10 12:35:19 UTC 2005


On Saturday 10 September 2005 13:03, Vincent Trouilliez wrote:
> Hi chaps,
>
> I am having an extremely annoying problem, that's driving me so mad, I
> am about to commit suicide I think, or become depressive at least :

Relax, man -- it's only code ;)

> My problem is that it doesn't seem to code extended ASCII characters
> properly. For example when I define a constant string that happens to
> include an extended character (which is very often, as all accented
> characters are >127, and all the special characters to draw tables/cells
> for example) :
>
> ----------
> const string[] = "Encore planté...";

> 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 !!

That's correct.

> So when the controller prints my 
> strings to an ASCII terminal, I don't get the expected characters !

The problem is that ASCII simply doesn't include such characters.  It's a 
7-bit character set, whereas ISO-8859-1 is an 8-bit character set, with many 
more characters.  If your terminal is truly plain ASCII, then it doesn't 
support ISO-8859, and you'll have to stick to basic characters used in 
everyday English.  One remote possibility is that you might be able to output 
e + backspace + ' to have it display e-acute.

> So basically I pretty much can't use strings in my programs...
> "annoying"... to say the least. :-/

Computers have only recently got to grips with Unicode on a wide-scale.  It 
takes a lot of computing power and resources to handle all of the world's 
languages at once.  Even with Unicode, some languages aren't fully supported 
yet.  I'd suggest just dropping the accent, but if you really need 
multilingual support, you might be able to find a more advanced embedded 
system -- something ARM-based might be a better bet.  Look for full unicode 
support, and UTF-8 output, though.

> If someone can help me put my Ubuntu straight, so I can just write
> strings in my programs and get them back as they look in the source
> code, I would be TRULY grateful ! :o(

This is nothing to do with Ubuntu, except maybe that Ubuntu has provided you 
with so much more that you miss it when it's gone :)

-- 
Lee Braiden
http://www.DigitalUnleashed.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050910/788f80f8/attachment.sig>


More information about the ubuntu-users mailing list