aboutsummaryrefslogtreecommitdiffstats
path: root/unicode/src/base/UTextEncoding.pas
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--unicode/src/base/UTextEncoding.pas5
1 files changed, 4 insertions, 1 deletions
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