Re: The Register interview Nigel Brown
- From: "Pierre le Riche" <pleriche@xxxxxxxxxxx>
- Date: Thu, 27 Apr 2006 12:32:21 +0200
Hi Allen,
string. WideString is a non-reference counted BSTR and as such the
performance isn't quite as good as string. The problem is that we used
the "cool" name for the BSTR...
While we're on the topic: Have you considered implementing a native UTF-8
encoded string type with automatic conversion routines for assignment
to/from WideString, AnsiString, etc?
The reason I ask this is because UTF-8 is much more storage space efficient
than UTF-16 (the format employed by the Windows/Uniscribe API) with European
languages. UTF-16 is more efficient in storing CJK (Chinese, Japanese and
Korean) language text, but that's about the only area where it has an edge
over UTF-8 IMO. In UTF-16 you still cannot represent all characters with a
single 16-bit encoding - only characters in the BMP (basic multilingual
plane), which does not include all Chinese characters. Of course, you'll
never escape combining characters even if you overboard and use UTF-32.
An opportunity recently opened up for me to provide software to the Chinese
market, and I am hurriedly implementing Unicode support in my custom
components. The implementation I decided on is to use UTF-8 throughout and
to only convert to UTF-16 when I need to call the Uniscribe API to render
text. The conversion from UTF-8 to UTF-16 is quite fast, and insignificant
relative to the time the Uniscribe API takes to render the text. (The other
issue that affected my decision was the fact that my database backend, SQL
Server 2000, only supports UCS-2 and not UTF-16.)
The other nice things about using UTF-8 is that I can use the existing
reference counted long string type for storage, and I can also continue
using most of my existing library of fast string routines.
If this request is not too outrageous, should I QC it?
Regards,
Pierre
.
- Follow-Ups:
- Re: The Register interview Nigel Brown
- From: Allen Bauer
- Re: The Register interview Nigel Brown
- From: Jonathan Benedicto
- Re: The Register interview Nigel Brown
- From: Eric Grange
- Re: The Register interview Nigel Brown
- From: Pierre le Riche
- Re: The Register interview Nigel Brown
- References:
- The Register interview Nigel Brown
- From: Jim Cooper
- Re: The Register interview Nigel Brown
- From: Thomas Miller
- Re: The Register interview Nigel Brown
- From: Allen Bauer
- The Register interview Nigel Brown
- Prev by Date: Re: Vista and .NET (Win32 life may be limted)
- Next by Date: Re: Vista and .NET (Win32 life may be limted)
- Previous by thread: Re: The Register interview Nigel Brown
- Next by thread: Re: The Register interview Nigel Brown
- Index(es):
Relevant Pages
|