Seminko Posted December 8, 2016 Share Posted December 8, 2016 Hey fellas, I have a bunch of words full of special characters like: künstler, アーティスト, 아티스트, художник, ศิลปิน, 畫家 and many many more. I have those along with other text in an array. For the text to correctly display in the array I used BinaryToString("text", 4) and it works PERFECTLY. However, when I do FileWrite("file.ini", array[1]), it skips the special chars replacing them with ' ? '. I tried using FileOpen, which doesn't help a bit. Also tried FileOpen with mode 128 or 256 but with those modes, nothing is written to the file AT ALL. Any ideas? Thx Link to comment Share on other sites More sharing options...
BrewManNH Posted December 8, 2016 Share Posted December 8, 2016 Are you trying to read the file with IniRead, seeing as it's an ini file? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Seminko Posted December 8, 2016 Author Share Posted December 8, 2016 I will do that but afterwards. Now I'm trying to create the ini file with all the special chars. (and, I can't use IniWrite just yet) Link to comment Share on other sites More sharing options...
Developers Jos Posted December 8, 2016 Developers Share Posted December 8, 2016 Works fine for me when simply doing: FileWrite("file.ini", "アーティスト, 아티스트, художник, ศิลปิน, 畫家 ") then opening file.ini with SciTE. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Seminko Posted December 8, 2016 Author Share Posted December 8, 2016 2 minutes ago, Jos said: Works fine for me when simply doing: FileWrite("file.ini", "アーティスト, 아티스트, художник, ศิลปิน, 畫家 ") then opening file.ini with SciTE. Jos This is what I see when I open the INI: ?—????, ????, ????????, ??????, ?? Link to comment Share on other sites More sharing options...
Developers Jos Posted December 8, 2016 Developers Share Posted December 8, 2016 How do you open the file? and if with SciTE: what are the file encoding settings when doing File/Encoding? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Seminko Posted December 8, 2016 Author Share Posted December 8, 2016 Double clicking it, not by a script. If I use a script to then read the ini, it will work? That seems so counter intuitive... Link to comment Share on other sites More sharing options...
Developers Jos Posted December 8, 2016 Developers Share Posted December 8, 2016 (edited) You're not answering my question .... What editor are you opening the "file.ini" in when you double click it? Edited December 8, 2016 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Seminko Posted December 8, 2016 Author Share Posted December 8, 2016 (edited) Oh sorry, my bad. Actually it is the good ol notepad. Even notepad++ only sees questionmarks... EDIT: even scite... Edited December 8, 2016 by Seminko Link to comment Share on other sites More sharing options...
Developers Jos Posted December 8, 2016 Developers Share Posted December 8, 2016 Ok, lets take this from the start: copy the line I posted in a new script that has the correct encoding, save and run it. check the created file.ini. if still wrong then zip the 2 files and PM the zip file to me. ps: which Scite version are you using? Jos Seminko 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Seminko Posted December 8, 2016 Author Share Posted December 8, 2016 Sent Link to comment Share on other sites More sharing options...
Seminko Posted December 8, 2016 Author Share Posted December 8, 2016 Jos' solution: update NOT ONLY SciTE but also Autoit3 . With the latest version works great! Thanks again Jos! Link to comment Share on other sites More sharing options...
BrewManNH Posted December 8, 2016 Share Posted December 8, 2016 You shouldn't need to create the file with anything other than IniWrite or IniWriteSection. There's no reason to use FileWrite first. If you want your INI file to be unicode compatible look here for how to do it. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now