summaryrefslogtreecommitdiff
path: root/rtl/win/sysutils.pp
diff options
context:
space:
mode:
authornickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-27 23:11:09 +0000
committernickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-27 23:11:09 +0000
commita491c935588745154b576226b73833bac78fcb6e (patch)
tree973289073fb5d21573a6be2b5cfeba9abd2a9472 /rtl/win/sysutils.pp
parent38b5e0606069cc5985e995e1da5b6855db67f507 (diff)
parentae5b0de491a91321675f73eae5db628d068f4e05 (diff)
downloadfpc-a491c935588745154b576226b73833bac78fcb6e.tar.gz
* synchronized with trunkunicodekvm
git-svn-id: https://svn.freepascal.org/svn/fpc/branches/unicodekvm@49282 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'rtl/win/sysutils.pp')
-rw-r--r--rtl/win/sysutils.pp13
1 files changed, 9 insertions, 4 deletions
diff --git a/rtl/win/sysutils.pp b/rtl/win/sysutils.pp
index 726b389fe2..2776b5e135 100644
--- a/rtl/win/sysutils.pp
+++ b/rtl/win/sysutils.pp
@@ -1037,14 +1037,19 @@ end;
Locale Functions
****************************************************************************}
-function GetLocaleStr(LID, LT: Longint; const Def: string): ShortString;
+function GetLocaleStr(LID, LT: Longint; const Def: string): AnsiString;
var
L: Integer;
- Buf: array[0..255] of Char;
+ Buf: unicodestring;
begin
- L := GetLocaleInfoA(LID, LT, Buf, SizeOf(Buf));
+ L := GetLocaleInfoW(LID, LT, nil, 0);
if L > 0 then
- SetString(Result, @Buf[0], L - 1)
+ begin
+ SetLength(Buf,L-1); // L includes terminating NULL
+ if l>1 Then
+ L := GetLocaleInfoW(LID, LT, @Buf[1], L);
+ result:=buf;
+ end
else
Result := Def;
end;