summaryrefslogtreecommitdiff
path: root/rtl/win/sysutils.pp
diff options
context:
space:
mode:
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;