ahmetpi 0 Posted December 12, 2020 Hi, I have an ini file which contains special Turkish characters like ş, Ö, İ, ı.... Example ini: [İnkılap] key=value [Türkçe] key=value Example code: $var1="İnkılap" $var2 = IniReadSection(".....inifilepath\example.ini", $var1) MsgBox(0, "Example", $var2 =) It returns nothing. So, how can i fix this? I am kinda noob so if you can give me an example code, i would be very glad Share this post Link to post Share on other sites
GokAy 60 Posted December 12, 2020 Selam, Your usage seems to be wrong? The return from inireadsection is an array The number of elements returned will be in $aArray[0][0]. If an @error occurs, no array is created. $aArray[0][0] = Number $aArray[1][0] = 1st Key $aArray[1][1] = 1st Value $aArray[2][0] = 2nd Key $aArray[2][1] = 2nd Value Try: msgbox(0,"Example", $var2[1][0] & " - " & $var2[1][1]) 1 ahmetpi reacted to this Share this post Link to post Share on other sites
ahmetpi 0 Posted December 12, 2020 3 minutes ago, GokAy said: Selam, Your usage seems to be wrong? The return from inireadsection is an array The number of elements returned will be in $aArray[0][0]. If an @error occurs, no array is created. $aArray[0][0] = Number $aArray[1][0] = 1st Key $aArray[1][1] = 1st Value $aArray[2][0] = 2nd Key $aArray[2][1] = 2nd Value Try: msgbox(0,"Example", $var2[1][0] & " - " & $var2[1][1]) Selam abi, çok teşekkürler cevapladığın için İngilizce bilgim çok iyi değil o yüzden Türkçe yazayım en iyisi Dediğiniz doğru IniReadSection'u yanlış kullanmışım ancak onu düzeltsem bile içinde Türkçe karakter olan section'ları getirmiyor nedense. Bu section name'leri bir input ile ini dosyasına kayıt ediyorum o input kısmında türkçe karakterleri elemem filan mümkün mü acaba? Belki o şekilde yapabilirim diye düşündüm ben Share this post Link to post Share on other sites
TheXman 405 Posted December 12, 2020 (edited) If you save your ini file with UTF-16LE with BOM encoding, it handles Turkish characters. #include <Constants.au3> #include <Debug.au3> example() Func example() Local $aIniSection $aIniSection = IniReadSection("test.ini", "Türkçe") If @error Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", "IniReadSection failed - @error = " & @error) _DebugArrayDisplay($aIniSection, "Türkçe Section") MsgBox($MB_ICONINFORMATION + $MB_TOPMOST, "Türkçe", "Key = " & IniRead("test.ini", "Türkçe", "Key", "Not Found")) EndFunc Edited December 12, 2020 by TheXman 1 1 ahmetpi and GokAy reacted to this About TheXman | CryptoNG UDF - Cryptography API: Next Gen | HttpApi UDF - HTTP Server API | jq UDF - Powerful and Flexible JSON Processor Share this post Link to post Share on other sites
GokAy 60 Posted December 12, 2020 (edited) @TheXman With this key-value pair the read key-value in SciTe is half correct [İnkılap] ççşş=asjsks Console Output: ççþþ - asjsks Edited December 12, 2020 by GokAy 1 ahmetpi reacted to this Share this post Link to post Share on other sites
TheXman 405 Posted December 12, 2020 (edited) The console will not display it correctly. Try MsgBox. Edited December 12, 2020 by TheXman 1 ahmetpi reacted to this About TheXman | CryptoNG UDF - Cryptography API: Next Gen | HttpApi UDF - HTTP Server API | jq UDF - Powerful and Flexible JSON Processor Share this post Link to post Share on other sites
GokAy 60 Posted December 12, 2020 (edited) Yes, it does. Thanks. Also, figured out I have never used Turkish in my code Edited December 12, 2020 by GokAy 1 1 TheXman and ahmetpi reacted to this Share this post Link to post Share on other sites