473,735 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unicode Normalization of Text Streams

Has it ever been proposed or posited within any C committee to define or
discuss (in a standard's document) the transformation of Unicode text I/O
according to a Unicode Normalization Form (assuming a locale which employs
a Unicode representation) ? Is such a capability implicit?

The notion exists and seems to work well for line/record delimiters
(e.g. "\r\n" -"\n").

- Bill

Sep 14 '06 #1
4 2540
William Ahern wrote:
>
Has it ever been proposed or posited within any
C committee to define or
discuss (in a standard's document)
the transformation of Unicode text I/O
according to a Unicode Normalization Form
(assuming a locale which employs
a Unicode representation) ? Is such a capability implicit?

The notion exists and seems to work well for line/record delimiters
(e.g. "\r\n" -"\n").
That seems more like a question for
news:comp.std.c
to me.

--
pete
Sep 14 '06 #2
On Thu, 14 Sep 2006 14:54:22 -0700, William Ahern
<wi*****@25than dClement.comwro te in comp.lang.c:
Has it ever been proposed or posited within any C committee to define or
discuss (in a standard's document) the transformation of Unicode text I/O
according to a Unicode Normalization Form (assuming a locale which employs
a Unicode representation) ? Is such a capability implicit?
I hardly think this is likely to ever be placed into the C standard. C
does not define or support Unicode at all, any more than it defines
ASCII or any other character set. The exact format and/or
representation of C's wide characters is completely
implementation-defined, and completely unspecified by the standard.

There is no requirement in the language that an implementation
supports or understands Unicode, nor any locales defined besides the C
locale.
>
The notion exists and seems to work well for line/record delimiters
(e.g. "\r\n" -"\n").
But I do agree with Pete, you certainly should ask in comp.std.c if
you want to discuss this.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Sep 15 '06 #3
William Ahern wrote:
Has it ever been proposed or posited within any C committee to define or
discuss (in a standard's document) the transformation of Unicode text I/O
according to a Unicode Normalization Form (assuming a locale which employs
a Unicode representation) ? Is such a capability implicit?
This is a complicated algorithm. In a demo normalizer I wrote, my
implementation took 107K of object code. It could likely be optimized,
but I would be surprised if you could get it under 30K or so. (Its
mostly because you need to encode the UniData table, of course.)
Besides, C does not support Unicode. So there is no reason to expect
such functionality from the language.

In a bizarre twist, however, someone has actually proposed some kind of
UTF codecs into the next C standard. I think, of course, this is
probably meant to be a joke to see if the ANSI C people are utterly and
completely incompetent or not -- since their actions to date do not
make it clear whether or not they are.

UTF encoders are, of course, trivial pieces of code anyone can write in
a few hours at most. But the key point is that they don't achieve any
useful functionality if you don't have other unicode support, such as a
normalizer, as you suggest above. But a unicode normalizer is
expensive (as I mentioned above) to implement. So either they go whole
hog and do a complete Unicode implementation (some implementations , of
course, map wchar_t to unicode -- so this is plausible), or they should
do nothing. There is no point in half measures that can't be really
used in practice.

This "depth" of reasoning may very well be beyond the capabilities of
the ANSI C committee, so its not clear to me at all what they will end
up doing.

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

Sep 15 '06 #4
Jack Klein wrote:
On Thu, 14 Sep 2006 14:54:22 -0700, William Ahern
<wi*****@25than dClement.comwro te in comp.lang.c:
>Has it ever been proposed or posited within any C committee to define or
discuss (in a standard's document) the transformation of Unicode text I/O
according to a Unicode Normalization Form (assuming a locale which employs
a Unicode representation) ? Is such a capability implicit?

I hardly think this is likely to ever be placed into the C standard. C
does not define or support Unicode at all, any more than it defines
ASCII or any other character set. The exact format and/or
representation of C's wide characters is completely
implementation-defined, and completely unspecified by the standard.
C supports ISO/IEC 10646 (Unicode) characters through the 'universal
character name' system.

The standard intends a C implementation to define __STDC_ISO_1064 6__ if
values of type wchar_t correspond to Unicode characters.

--
Simon.
Sep 19 '06 #5

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

Similar topics

3
17620
by: Michael Weir | last post by:
I'm sure this is a very simple thing to do, once you know how to do it, but I am having no fun at all trying to write utf-8 strings to a unicode file. Does anyone have a couple of lines of code that - opens a file appropriately for output - writes to this file Thanks very much. Michael Weir
1
2165
by: krammer | last post by:
Hello, I have the following questions that I have not been able to find any *good* answers for. Your help would me much appreciated!, fyi, I am a Java XML guy and I have no experience with SGML so my questions will probably be XML biased. 1) Is is possible to have Unicode text inside an SGML file? an example would be something like this.......
2
4514
by: ASP | last post by:
Why this code doesn't work ? The "testUnicode.asp" file is in Unicode UTF-8 and use the Normalization Form C with the Byte Order Mark (BOM, or Unicode Signature). <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head>
7
9008
by: Michael Davis | last post by:
Hi, I've known C/C++ for years, but only ever used ascii strings. I have a client who wants to know how gcc handles unicode. I've found the functions utf8_mbtowc, utf8_mbstowcs, utf8_wctomb and utf8_wcstombs, but I'm wondering if there are any other libraries or functions which can do things like handle different kinds of encodings? Thanks Michael Davis
10
8093
by: Nikolay Petrov | last post by:
How can I convert DOS cyrillic text to Unicode
18
620
by: Chameleon | last post by:
I am trying to #define this: #ifdef UNICODE_STRINGS #define UC16 L typedef wstring String; #else #define UC16 typedef string String; #endif ....
0
1656
by: turbovince | last post by:
Hello, I'm writing methods that receive an UTF8 C-String from a SOAP Server and I'd need to normalize it so that accents and similar characters get removed. So in fact, I want to achieve the Unicode NDF (Normalization Form D), something like: http://www.unicode.org/unicode/reports/tr15/images/UAX15-NormFig4.jpg
1
1135
by: Christian Heimes | last post by:
Peter Robinson schrieb: As John already said: UTF-8 ain't unicode. UTF-8 is an encoding similar to ASCII or Latin-1 but different in its inner workings. A single character may be encoded by up to 6 bytes. I highly recommend Joel's article on unicode: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)
5
2598
by: Thierry | last post by:
Hello fellow pythonists, I'm a relatively new python developer, and I try to adjust my understanding about "how things works" to python, but I have hit a block, that I cannot understand. I needed to output unicode datas back from a web service, and could not get back unicode/multibyte text before applying an hack that I don't understand (thank you google) I have realized an wxPython simple application, that takes the input
0
9466
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
9330
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
9255
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,...
1
6748
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6050
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4823
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3278
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
2741
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2191
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.