๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: UTF-8 conversion is it safe to asume ?

#1282
From: Eelke
Date: Mon, 01 Oct 2007 12:06
23 lines
1710 bytes
Asger Jรธrgensen schreef:
> Hi there
> 
> I use MultiByteToWideChar on my UTF-8 datastreams to 
> get the size of the buffer needed for converting, 
> that works just fine.
> 
> Sometimes the function returns the exact same size 
> as the original stream.
> Can I, in theses cases, assume that there is no 
> characters in the stream that needs to be converted ??
> And the go on processing the contents without 
> converting it ?
> 
> Thanks in advance
> Kind regards
> Asger

No, afaik there is no garantee that a 2 byte mbchar is the same as the 
widechar second the mbstring could also contain 3 byte and 1 byte 
mbchars which would definitly not be the same.

Eelke
Technical Details
Message-ID: <4700e2ab$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <MPG.216867aaf4046a9c98982c@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,98822b795d44732
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,UTF8
Date: Mon, 01 Oct 2007 14:06:13 +0200
From: Eelke <e.klein@remove.mplussoftware.nl>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: UTF-8 conversion is it safe to asume ?
References: <MPG.216867aaf4046a9c98982c@newsgroups.borland.com>
In-Reply-To: <MPG.216867aaf4046a9c98982c@newsgroups.borland.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 195.241.133.37
Message-ID: <4700e2ab$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1191240363 195.241.133.37 (1 Oct 2007 05:06:03 -0700)
Lines: 23
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail