Re: Defacto standard string library
- From: Phil Carmody <thefatphil_demunged@xxxxxxxxxxx>
- Date: Sat, 03 Jan 2009 21:52:35 +0200
richard@xxxxxxxxxxxxxxx (Richard Tobin) writes:
In article <ANN7l.14634$Sp5.13522@xxxxxxxxxxxxxxxxxxxxxxxxx>,
Bartc <bartc@xxxxxxxxxx> wrote:
strcmp() will only work on UTF-8 if you make use of the result as either 0
or not 0.
No, it will give Unicode ordering.
And if you use strcmp() on mixed UTF-8 and ordinary strings, then
the result might be meaningless (a string containing a single encoded
Unicode Character could match a string of several ordinary chars).
If you use strcmp() between strings in different encodings of course
the result is likely to be meaningless. However UTF-8 has the advantage
that it can be compared against ascii, since ascii is a subset of UTF-8.
How does "\xEF\xBB\xBF\x40" compare against "\x41" using strcmp()?
Phil
--
I tried the Vista speech recognition by running the tutorial. I was
amazed, it was awesome, recognised every word I said. Then I said the
wrong word ... and it typed the right one. It was actually just
detecting a sound and printing the expected word! -- pbhj on /.
.
- Follow-Ups:
- Re: Defacto standard string library
- From: Richard Tobin
- Re: Defacto standard string library
- From: Stephen Sprunk
- Re: Defacto standard string library
- From: Bartc
- Re: Defacto standard string library
- References:
- Re: Defacto standard string library
- From: user923005
- Re: Defacto standard string library
- From: Keith Thompson
- Re: Defacto standard string library
- From: Bartc
- Re: Defacto standard string library
- From: Richard Tobin
- Re: Defacto standard string library
- Prev by Date: Re: generic linklist
- Next by Date: Re: A bit of fun. A programming puzzle to be done in C.
- Previous by thread: Re: Defacto standard string library
- Next by thread: Re: Defacto standard string library
- Index(es):
Relevant Pages
|