Bug in idGlobal with ToBytes function and .NET

Giganews Newsgroups
Subject: Bug in idGlobal with ToBytes function and .NET
Posted by:  Marko Vodopija (marko…@SPAMindex.hr)
Date: Fri, 27 Feb 2004

There is a major bug in idGlobal.pas unit when converting string to TBytes:
  {$IFDEF DotNet}
  Result := AnsiEncoding.GetBytes(AValue);
  {$ELSE}

This works most of the time but when you are writing UTF-8 encoded string to
socket with some high byte characters, it converts them to ?.
AnsiEncoding class should not be used here, even on .NET
When I manually converted my UTF-8 encoded string to TBytes, everything
worked as expected.

Replies