473,669 Members | 2,504 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

UTF-8 locales

As I understand it (correct me, if I am wrong) Unicode came into
picture so that a document containing multiple language characters can
be supported like somebody can write a document comparing Korean and
Chinese in French language.

Now, I am looking at all UNIX platforms and seems like all Unix (AIX,
HP, Solaris) platforms support Unicode by supporting language/region
specific UTF-8 locales like fr_FR.UTF-8, ja_JP.UTF-8, ko_KR.UTF-8 etc.

Now in order to use UTF-8 for Japanese, I have to set locale to
ja_JP.UTF-8. To use UTF-8 for Korean, I have to set locale to
ko_KR.UTF-8.

With this approach it's not possible to mix multiple language
characters. Doesn't this defeat the whole purpose of Unicode ?
Am I missing something ?

Thanks in advance for any insight you can provide.

Nov 14 '05 #1
7 3076
In article <11************ **********@z14g 2000cwz.googleg roups.com>,
sa*********@gma il.com wrote:
As I understand it (correct me, if I am wrong) Unicode came into
picture so that a document containing multiple language characters can
be supported like somebody can write a document comparing Korean and
Chinese in French language.

Now, I am looking at all UNIX platforms and seems like all Unix (AIX,
HP, Solaris) platforms support Unicode by supporting language/region
specific UTF-8 locales like fr_FR.UTF-8, ja_JP.UTF-8, ko_KR.UTF-8 etc.

Now in order to use UTF-8 for Japanese, I have to set locale to
ja_JP.UTF-8. To use UTF-8 for Korean, I have to set locale to
ko_KR.UTF-8.

With this approach it's not possible to mix multiple language
characters. Doesn't this defeat the whole purpose of Unicode ?
Am I missing something ?


A locale describes much more than just the characters.

There are for example the rules for formatting a number. Threethousand
twohundred and six hundredths is 3,200.06 in one locale and 3.200,06 in
another and 3'200.06 in a third locale.

There are rules how to display monetary values. There are rules how to
sort text. There are rules how to display dates. They all will be
different between locales.
Nov 14 '05 #2
sa*********@gma il.com wrote:
As I understand it (correct me, if I am wrong) Unicode came into
picture so that a document containing multiple language characters can
be supported like somebody can write a document comparing Korean and
Chinese in French language.

Now, I am looking at all UNIX platforms and seems like all Unix (AIX,
HP, Solaris) platforms support Unicode by supporting language/region
specific UTF-8 locales like fr_FR.UTF-8, ja_JP.UTF-8, ko_KR.UTF-8 etc.

Now in order to use UTF-8 for Japanese, I have to set locale to
ja_JP.UTF-8. To use UTF-8 for Korean, I have to set locale to
ko_KR.UTF-8.

With this approach it's not possible to mix multiple language
characters. Doesn't this defeat the whole purpose of Unicode ?
Am I missing something ?

Thanks in advance for any insight you can provide.

I am not certain how this works on Unix platforms. However I suspect
that the locale has an effect on local conventions as the previous
poster mentioned. I.e date formats and what not.

You still should be able to display any language no matter what locale
you have set, i.e in ja_JP.UTF-8 you should still be able to display
French an Chinese and so on. Try it. ( You must have fonts capable of
mapping those characters of course, if it doesn't work try changing font
- look on the web for names of the fonts that support the glyphs that
are needed )
Nov 14 '05 #3
sa*********@gma il.com wrote:

As I understand it (correct me, if I am wrong) Unicode came into
picture so that a document containing multiple language characters
can be supported like somebody can write a document comparing
Korean and Chinese in French language.

Now, I am looking at all UNIX platforms and seems like all Unix
(AIX, HP, Solaris) platforms support Unicode by supporting
language/region specific UTF-8 locales like fr_FR.UTF-8,
ja_JP.UTF-8, ko_KR.UTF-8 etc.


.... snip ...

This is off-topic in c.l.c. Try a newsgroup with unix, posix, aix,
solaris, etc. in its name. c.l.c deals with the actual portable
language as defined in the C standard. As soon as you have to
specify a system or compiler, you become off-topic.

--
"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare
Nov 14 '05 #4
In message <42************ ***@yahoo.com>
CBFalconer <cb********@yah oo.com> wrote:
sa*********@gma il.com wrote:

Now, I am looking at all UNIX platforms and seems like all Unix
(AIX, HP, Solaris) platforms support Unicode by supporting
language/region specific UTF-8 locales like fr_FR.UTF-8,
ja_JP.UTF-8, ko_KR.UTF-8 etc.


... snip ...

This is off-topic in c.l.c. Try a newsgroup with unix, posix, aix,
solaris, etc. in its name. c.l.c deals with the actual portable
language as defined in the C standard. As soon as you have to
specify a system or compiler, you become off-topic.


Which is of course why the whole locale system and wchar_t are effectively
useless for portable programming. Everything about them is
implementation-defined, so you can't even talk about them in comp.*.c :(

Is there anywhere where one could discuss "best practice" or standardisation
for these facilities?

--
Kevin Bracey, Principal Software Engineer
Tematic Ltd Tel: +44 (0) 1223 503464
182-190 Newmarket Road Fax: +44 (0) 1728 727430
Cambridge, CB5 8HE, United Kingdom WWW: http://www.tematic.com/
Nov 14 '05 #5
Kevin Bracey wrote:
In message <42************ ***@yahoo.com>
CBFalconer <cb********@yah oo.com> wrote:

sa*********@g mail.com wrote:
Now, I am looking at all UNIX platforms and seems like all Unix
(AIX, HP, Solaris) platforms support Unicode by supporting
language/region specific UTF-8 locales like fr_FR.UTF-8,
ja_JP.UTF-8, ko_KR.UTF-8 etc.


... snip ...

This is off-topic in c.l.c. Try a newsgroup with unix, posix, aix,
solaris, etc. in its name. c.l.c deals with the actual portable
language as defined in the C standard. As soon as you have to
specify a system or compiler, you become off-topic.

Which is of course why the whole locale system and wchar_t are effectively
useless for portable programming. Everything about them is
implementation-defined, so you can't even talk about them in comp.*.c :(

Is there anywhere where one could discuss "best practice" or standardisation
for these facilities?


Ack.
I really would be interested in that, too.
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 14 '05 #6
Michael Mair wrote:
Kevin Bracey wrote:
CBFalconer <cb********@yah oo.com> wrote:
sa*********@gma il.com wrote:

Now, I am looking at all UNIX platforms and seems like all Unix
(AIX, HP, Solaris) platforms support Unicode by supporting
language/region specific UTF-8 locales like fr_FR.UTF-8,
ja_JP.UTF-8, ko_KR.UTF-8 etc.

... snip ...

This is off-topic in c.l.c. Try a newsgroup with unix, posix, aix,
solaris, etc. in its name. c.l.c deals with the actual portable
language as defined in the C standard. As soon as you have to
specify a system or compiler, you become off-topic.


Which is of course why the whole locale system and wchar_t are
effectively useless for portable programming. Everything about
them is implementation-defined, so you can't even talk about them
in comp.*.c :(

Is there anywhere where one could discuss "best practice" or
standardisation for these facilities?


Ack.
I really would be interested in that, too.


I would consider comp.programmin g quite suitable for this sort of
general internationaliz ation discussion.

--
Chuck F (cb********@yah oo.com) (cb********@wor ldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net> USE worldnet address!
Nov 14 '05 #7
Kevin Bracey wrote:
CBFalconer <cb********@yah oo.com> wrote:
sa*********@gma il.com wrote:
Now, I am looking at all UNIX platforms and seems like all Unix
(AIX, HP, Solaris) platforms support Unicode by supporting
language/region specific UTF-8 locales like fr_FR.UTF-8,
ja_JP.UTF-8, ko_KR.UTF-8 etc.
... snip ...

This is off-topic in c.l.c. Try a newsgroup with unix, posix, aix,
solaris, etc. in its name. c.l.c deals with the actual portable
language as defined in the C standard. As soon as you have to
specify a system or compiler, you become off-topic.


Which is of course why the whole locale system and wchar_t are
effectively useless for portable programming. Everything about
them is implementation-defined, so you can't even talk about
them in comp.*.c :(


Yeah, amazing he doesn't see the irony of his own statement. The
wchar_t types and functions are only portable in the very narrow scope
of "I can compile that source code to do something" sense. But since
the definition of wchar_t is so open ended, system dependent, and in
fact *NOT* universal in any real sense, there's no way you can actually
use it for any truly portable applications.

And there's no way to somehow "augment" the specification, or use these
types/function in some special way to *make* them portable. There are
no ifdef tricks or anything like that -- you're just screwed. The
whole wchar_t idea literally has no relevant functional content.

C's whole misconception of what it means to be portable, is in fact
what *prevents* it from being portable where it counts, on issues like
localization.
Is there anywhere where one could discuss "best practice" or
standardisation for these facilities?


Well more importantly, portability in general, really can't be
discussed in comp.lang.c. I lurk on comp.programmin g, so you can
always throw questions about portability there.

---
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

Nov 14 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4159
by: lawrence | last post by:
Someone on www.php.net suggested using a seems_utf8() method to test text for UTF-8 character encoding but didn't specify how to write such a method. Can anyone suggest a test that might work? Something that maybe gives 90% confidence that a given block of text is or is not UTF-8 encoded?
4
6391
by: Alban Hertroys | last post by:
Another python/psycopg question, for which the solution is probably quite simple; I just don't know where to look. I have a query that inserts data originating from an utf-8 encoded XML file. And guess what, it contains utf-8 encoded characters... Now my problem is that psycopg will only accept queries of type str, so how do I get my utf-8 encoded data into the DB? I can't do query.encode('ascii'), that would be similar to: >>> x =...
12
8213
by: Mike Dee | last post by:
A very very basic UTF-8 question that's driving me nuts: If I have this in the beginning of my Python script in Linux: #!/usr/bin/env python # -*- coding: UTF-8 -*- should I - or should I not - be able to use non-ASCII characters in strings and in Tk GUI button labels and GUI window titles and in raw_input data without Python returning wrong case in manipulated
38
5730
by: Haines Brown | last post by:
I'm having trouble finding the character entity for the French abbreviation for "number" (capital N followed by a small supercript o, period). My references are not listing it. Where would I find an answer to this question (don't find it in the W3C_char_entities document). -- Haines Brown brownh@hartford-hwp.com
6
18751
by: jmgonet | last post by:
Hello everybody, I'm having troubles loading a Xml string encoded in UTF-8. If I try this code: ------------------------------ XmlDocument doc=new XmlDocument(); String s="<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><a>Schönbühl</a>"; doc.LoadXml(s); doc.Save("d:\\temp\\test.xml");
6
13887
by: archana | last post by:
Hi all, can someone tell me difference between unicode and utf 8 or utf 18 and which one is supporting more character set. whic i should use to support character ucs-2. I want to use ucs-2 character in streamreader and streamwriter. How unicode and utf chacters are stored.
7
12137
by: Jimmy Shaw | last post by:
Hi everybody, Is there any SIMPLE way to convert from UTF-16 to UTF-32? I may be mixed up, but is it possible that all UTF-16 "code points" that are 16 bits long appear just the same in UTF-32, but with zero padding and hence no real conversion is necessary? If I am completely wrong and some intricate conversion operation needs to take place, can anyone give me some primer on the subject?
1
7283
by: sheldon.regular | last post by:
I am new to unicode so please bear with my stupidity. I am doing the following in a Python IDE called Wing with Python 23. äöü äöü '\xc3\xa4\xc3\xb6\xc3\xbc' u'\xe4\xf6\xfc' u'\xe4\xf6\xfc' äöü
10
19544
by: Jed | last post by:
I have a form that needs to handle international characters withing the UTF-8 character set. I have tried all the recommended strategies for getting utf-8 characters from form input to email message and I cannot get it to work. I need to stay with classic asp for this. Here are some things I tried: 'CDONTS Call msg.SetLocaleIDs(65001)
23
5011
by: Allan Ebdrup | last post by:
I hava an ajax web application where i hvae problems with UTF-8 encoding oc chineese chars. My Ajax webapplication runs in a HTML page that is UTF-8 Encoded. I copy and paste some chineese chars from another HTML page viewed in IE7, that is also UTF-8 encoded (search for "china" on google.com). I paste the chineese chars into a content editable div. My Ajax webservice compiles an XML where the data from the content editable div is...
0
8383
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8895
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8809
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8588
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4386
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2797
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.