Browse Source

* correctly handle code page names specified in upper case (mantis #28934)

git-svn-id: trunk@32202 -
Jonas Maebe 9 years ago
parent
commit
4decb81ac4
3 changed files with 17 additions and 2 deletions
  1. 1 0
      .gitattributes
  2. 2 2
      compiler/widestr.pas
  3. 14 0
      tests/webtbs/tw28934.pp

+ 1 - 0
.gitattributes

@@ -14815,6 +14815,7 @@ tests/webtbs/tw28850.pp svneol=native#text/plain
 tests/webtbs/tw2886.pp svneol=native#text/plain
 tests/webtbs/tw2891.pp svneol=native#text/plain
 tests/webtbs/tw2892.pp svneol=native#text/plain
+tests/webtbs/tw28934.pp svneol=native#text/plain
 tests/webtbs/tw2897.pp svneol=native#text/plain
 tests/webtbs/tw2899.pp svneol=native#text/plain
 tests/webtbs/tw2904.pp svneol=native#text/plain

+ 2 - 2
compiler/widestr.pas

@@ -334,7 +334,7 @@ unit widestr;
         p : punicodemap;
       begin
         Result:=0;
-        p:=getmap(s);
+        p:=getmap(lower(s));
         if (p<>nil) then
           Result:=p^.cp;
       end;
@@ -345,7 +345,7 @@ unit widestr;
       var
         p2: pchar;
         i, chars, codepointlen: sizeint;
-      {$ENDIF FPC_HAS_CPSTRING}
+      {$ENDIF FPC_HAS_CPSRING}
       begin
 {$IFDEF FPC_HAS_CPSTRING}
         if len=0 then

+ 14 - 0
tests/webtbs/tw28934.pp

@@ -0,0 +1,14 @@
+{ %norun }
+{ %opt=-FcCP1252 }
+
+program project1;
+
+Type
+  WideArray = array [0..3] of Widechar;
+
+var
+  Test: WideArray;
+
+begin
+  Test := 'hmmm';
+end.