🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internationalization
Article #17

Re: What is the different between AnsiString and UTF8String?

#17
From: Jaakko Salmenius
Date: Thu, 11 Jan 2007 09:26
23 lines
2046 bytes
What do you mean encoded? As far as I see they are both encoded.

UTF8String contains UTF-8 encoded Unicode string. Each character is 1, 2, 3, 
4 bytes long.

AnsiString contains code page encoded string. Depending on the code page 
each character is either 1, or 1 or 2 characters long. Asian code pages use 
multi byte encoding code pages where each character is either 1 byte or 2 
bytes. All Windows code pages has identical first 128 characters. If the 
most significant byte of an AnsiString is 1 then the byte is extended byte 
that is either single character (such as � or � in code page 1252) or needs 
the following byte to describe the character.

Also in AnsiString you will see garbage if the system code page does not 
match the code page used in the string. For example using Japanese (code 
page 932) string on English Windows.

Both UTF8String and AnsiString must be read byte by byte to get the real 
meaning.

Best regards,
Jaakko Salmenius
www.sisulizer.com 
Technical Details
Message-ID: <45a602a3$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!tudelft.nl!txtfeed1.tudelft.nl!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45a29580@newsgroups.borland.com> <45a4a963@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10297d,df1e44fdeda5937e
X-Google-Attributes: gid10297d,public
X-Google-Language: ENGLISH,ASCII
From: "Jaakko Salmenius" <jaakko.salmenius (at) sisulizer.com>
Newsgroups: borland.public.cppbuilder.internationalization
References: <45a29580@newsgroups.borland.com> <45a4a963@newsgroups.borland.com>
Subject: Re: What is the different between AnsiString and UTF8String?
Date: Thu, 11 Jan 2007 18:26:13 +0900
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 58.156.14.236
Message-ID: <45a602a3$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1168507555 58.156.14.236 (11 Jan 2007 01:25:55 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!tudelft.nl!txtfeed1.tudelft.nl!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail