🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1345

UTF-16 are killing me, please help

#1345
From: Asger Jørgensen
Date: Sat, 22 Sep 2007 23:29
28 lines
1556 bytes
Hi there

I have tryed and tryed, but with no luck.

I have some files in Unicode mostly UTF-8 and with 
them I have no trouble.
 
But the UTF-16 files are making me loo my last to hair

For UTF-8 I use TMemoryStream->LoadFromFile and then
MultiByteToWideChar and WideCharToMultiByte 
learned here in the NG and it works grat.

When I load a UTF-16 file into the TMemoryStream
it is totaly crap.

I have a hex editor and when I open the same file
in that the first to bytes are FF and FE the next 
is the first real character in the file < after 
that a 0 ? 0 x and so on everything looks as expected.

I realy hope sombody have an example on how to 
read a UTF-16  plain text file

Thanks in advance
Asger

 
Technical Details
Message-ID: <MPG.215fc3c34331af6a989814@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4823f79f766c834b,start
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Asger Jørgensen <junk@Asger-P.dk>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: UTF-16 are killing me, please help
Date: Sun, 23 Sep 2007 01:29:29 +0200
Message-ID: <MPG.215fc3c34331af6a989814@newsgroups.borland.com>
Organization: Asger-P
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
User-Agent: MicroPlanet-Gravity/2.70.2067
NNTP-Posting-Host: 83.73.213.92
X-Trace: newsgroups.borland.com 1190503764 83.73.213.92 (22 Sep 2007 16:29:24 -0700)
Lines: 28
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail