[Lazarus] Windows API calls and german Umlauts

John Landmesser jmlandmesser at gmx.de
Thu Mar 10 17:28:45 CET 2016


Am 09.03.2016 um 14:16 schrieb Mattias Gaertner:
> On Wed, 9 Mar 2016 13:04:50 +0100
> "John Landmesser" <JMLandmesser at gmx.de> wrote:
>
>> Hi,
>>   
>> if i call a windows API function for special folder, like:
>>   
>> uses
>> ...
>> shlobj;
>>   
>> var
>>    AppDataPath: Array[0..MaxPathLen] of Char;
>> begin
>>    SHGetSpecialFolderPath(0,AppDataPath,CSIDL_STARTUP,false);
>> end;
>>   
>> I get on a german localized Windows XP a path containing  "\Startmenü\", but the "ü" is "?" in the resulting string.
>>   
>> Howto convert  the chars in AppDataPath to get the "Umlauts" correct?
> According to msdn SHGetSpecialFolderPath is not supported by Microsoft.
> Instead, use ShGetFolderPath.
>
> Unit LazFileUtils has already a more sophisticated implementation
> for UTF8. I added
> function SHGetFolderPathUTF8(ID :  Integer) : String;
>
> Mattias
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


that's why opensource is unbeatable:

asked a question at 14:00 h, got a new function in Lazarus at 14:15 h

Thanks Mattias and all people involved!




More information about the Lazarus mailing list