Browse Source

* utf-8 fix from Rimgaudas Laucius

git-svn-id: trunk@556 -
florian 20 years ago
parent
commit
cefa8ce9b9
2 changed files with 7 additions and 1 deletions
  1. 6 1
      compiler/scanner.pas
  2. 1 0
      tests/test/tutf81.pp

+ 6 - 1
compiler/scanner.pas

@@ -2996,7 +2996,12 @@ implementation
                                  concatwidestringchar(patternw,tcompilerwidechar(c))
                              end
                            else if iswidestring then
-                             concatwidestringchar(patternw,asciichar2unicode(c))
+                             begin
+                               if aktsourcecodepage='utf8' then
+                                 concatwidestringchar(patternw,ord(c))
+                               else
+                                 concatwidestringchar(patternw,asciichar2unicode(c))
+                             end
                            else
                              begin
                                if len<255 then

+ 1 - 0
tests/test/tutf81.pp

@@ -3,4 +3,5 @@
 begin
   w:='äüö';
   writeln(w);
+  writeln('äa');
 end.