Re: Omega character



On Sun, 10 Apr 2005 09:04:03 +0200
"David Necas (Yeti)" <yeti physics muni cz> wrote:

On Sun, Apr 10, 2005 at 02:40:38AM -0300, John Coppens wrote:
Of all things, I didn't think this would be so difficult. I want to
put a string on the screen with electrical units, and the Ohms-(Omega)
character. I normally write characters in the locale set and then call
g_locale_to_utf8, but I can't find the character Omega in the local
set (0xBD is occupied with the 1/2 symbol).

If I understand correctly, you write strings in your
compile-time locale charset and then convert these
strings from run-time locale charset to UTF-8 with
g_locale_to_utf8().

This is borken (beside inefficient), as these two locales
can easily differ.  Don't do that (and if you do that, be
prepared people from non-Western countries will hate you).

Hello Yeti.

Thanks for the reply, I've never really thought much about about the
consequences of using the locale to generate programs (in my
defense:the locale is 'C' which should be available everywhere).

You can always write UTF-8 characters expanded with escapes
"\xe2\x84\xa6" (this is Ohm sign which is different from
capital Omega "\xce\xa9", BTW) if you don't want to use
UTF-8 directly, which is no problem nowadays.

I suspected this, but when I call locale-to-utf8, I get something like
Ï<copyright>. Not calling locale-to-utf8 works fine, but I'll have to
escape all special characters, probably even simple things like 'é'.

A question: What happens if the destination machine doesn't have the
sophisticated Ohms sign? Or even the Omega?

Thanks,
John



Yeti


--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]