From 70a287773fc7001b810b9f91daf6d6e941e662f3 Mon Sep 17 00:00:00 2001 From: tobigun Date: Sat, 1 Nov 2008 11:04:27 +0000 Subject: - freetype enabled by default - Result[DstPos] := WideChar(Src[SrcPos]) must be Result[DstPos] := WideChar(Ord(Src[SrcPos])) otherwise FPC (but not Delphi) will convert the character according to current locale. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1495 b956fd51-792f-4845-bead-9b4dfca2ff2c --- unicode/src/base/UTextEncoding.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'unicode/src/base/UTextEncoding.pas') diff --git a/unicode/src/base/UTextEncoding.pas b/unicode/src/base/UTextEncoding.pas index 6eec8eec..ae36a270 100644 --- a/unicode/src/base/UTextEncoding.pas +++ b/unicode/src/base/UTextEncoding.pas @@ -115,7 +115,10 @@ begin if (Src[SrcPos] < #128) then begin // copy ASCII char - Result[DstPos] := Src[SrcPos]; + // Important: the Ord() is necessary to prevent FPC from an automatic + // encoding conversion (using the local codepage). Delphi does not perform + // such a conversion. + Result[DstPos] := WideChar(Ord(Src[SrcPos])); Inc(DstPos); end else -- cgit v1.2.3