WinDirs Unicode lazarus / 34-Windows ---------------------------------------------------------------------- skiy1337lazarus · 2015-10-15 03:05 Looking at this code for the new WinDirs unit: http://svn.freepascal.org/cgi- bin/viewvc.cgi/trunk/rtl/win/windirs.pp?view=markup It appears, as far as I can tell, that GetWindowsSpecialDir is not going to work in Lazarus 1.6 Might it be declared as SHGetFolderPathW ? So that it is converted to UTF8 ---------------------------------------------------------------------- skiy1337lazarus · 2015-10-15 03:52 OK I just answered my own question: GetWindowsSpecialDir uses the StrPas function. The StrPas function returns a ShortString. ShortString uses a different locale to AnsiString -- just tested. So it should work as is. ---------------------------------------------------------------------- ademir.uem · 2016-04-01 16:39 I have a following problem with GetWindowsSpecialDir. I have a directory named: c:\users\andréia\Documents\  Note the special character é that is typical em Portuguese language. When I run: GetCurrentDir (into that directory) , I get a correct result:   c:\users\andréia\Documents\ But when I use GetWindowsSpecialDir(CSIDL_PERSONAL) , I get this result: c:\users\andr?ia\Documents\ The special character is missing.  Why? How can I correct it? Thanks. Ademir ---------------------------------------------------------------------- thierrybo · 2016-04-18 21:36 I think this is a bug : http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus- GetAppConfigDir-on-Windows-XP-PT-BR-Configura-es- td4047882.html#d1459528600000-157 ---------------------------------------------------------------------- Thaddy · 2016-04-19 06:29 And that bug is fixed in 1.7 ---------------------------------------------------------------------- thierrybo · 2016-04-19 16:11 By the way you can use : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i WinCPToUTF8(GetWindowsSpecialDir(CSIDL_PERSONAL)) to get the correct result (RTL with default codepage UTF-8) : QuoteWhen accessing the WinAPI you must use the "W" functions or use the functions UTF8ToWinCP and WinCPToUTF8. The same is true for libraries that still use Ansi WinAPI function. For example in FPC 3.0 and below the unit registry needs this.