From 4decb81ac461f5869f1e7ca379b1b5758008214a Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Fri, 30 Oct 2015 15:10:26 +0000 Subject: [PATCH] * correctly handle code page names specified in upper case (mantis #28934) git-svn-id: trunk@32202 - --- .gitattributes | 1 + compiler/widestr.pas | 4 ++-- tests/webtbs/tw28934.pp | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 tests/webtbs/tw28934.pp diff --git a/.gitattributes b/.gitattributes index 4100a99ac4..ef534cf480 100644 --- a/.gitattributes +++ b/.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 diff --git a/compiler/widestr.pas b/compiler/widestr.pas index eb20a25948..ce0e5dbcce 100644 --- a/compiler/widestr.pas +++ b/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 diff --git a/tests/webtbs/tw28934.pp b/tests/webtbs/tw28934.pp new file mode 100644 index 0000000000..493c36710c --- /dev/null +++ b/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.