charvi Posted January 29, 2009 Author Posted January 29, 2009 (edited) could you attach the 2 script here for testing to ensure we test we the correct settings? JosI uploaded JpMain.au3 and JpConst.au3 JpMain.au3 JpConst.au3 Edit: I added the working version: JpWorking.au3 It's clear that when the main program is launched, the compiler verifies if there are some Unicode only in the main program so it compiles with Unicode, but in my example with #include it does not verifies in JpConst.au3 (where only there an Unicode string is found), hence the garbage. Please do not forget to modify the file "C:\Program Files\AutoIt3\SciTE\SciTEGlobal.properties" must be changed manually: code.page=65001 and character.set=0 Suggested solution: a program line that forces Unicode Compilation. Cheers, Charvi Edited January 29, 2009 by charvi
Developers Jos Posted January 29, 2009 Developers Posted January 29, 2009 The JpConst.au3 is not the same fileformat as the other and doesn't have the UTF-8 BOM. Try saving it with the same encodig as your other files. My pc does show the characters in SciTE but nothing readable when running the scripts so cannot easily test. 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.
charvi Posted January 29, 2009 Author Posted January 29, 2009 (edited) The JpConst.au3 is not the same fileformat as the other and doesn't have the UTF-8 BOM. Try saving it with the same encodig as your other files. My pc does show the characters in SciTE but nothing readable when running the scripts so cannot easily test.You are right, I forgot to select UTF-8 BOM in JpConst.au3 when I sent it to the forum (due to my various testings). But setting it afterwards doesn't change anything. Please try the following scenario: 0) Start SciTE (if SciTE was running, exit it and re-invoke it) 1) Be sure that JpConst.au3 has encoding UTF-8 BOM. 2) Run JpMain.au3 and be sure for yourself that you are seeing garbage. 3) Now add in JpConst.au3 the following line: MsgBox(0, "", $s) 4) Run JpConst.au3 (not the JpMain.au3). You will see that it works now. This may be normal as the unicode line is in the main program. But now: 5) Remove the just added msgbox line, save it 6) Run JpMain.au3 and you will see that it works now. Strange, isn't it? Now I believe that a flag is added somewhere... Edit1: added point 0) Edit2: hexadecimal dump of the JpConst.au3 file shows me that an Unicode file should begin with 0xEFBBBF. Edited January 29, 2009 by charvi
charvi Posted January 29, 2009 Author Posted January 29, 2009 (edited) Jos,Finally, I think I know why it did not work. In fact, AutoIt has NOT REALLY a bug, and that's good news. When changing the encoding (File/Encoding), the program is NOT set to modified state, so when I save the program, it does nothing, and that's why I thought there was a bug. If I change the encoding and add a character anywhere in the script, the modified state is set to 1 (can be seen at the asterisk close to the file name in the tab), then the Save has an effect.So, EVEN when changing the encoding mode, the program must be considered as being modified, so that when saving the program, it adds the flag 0xEFBBBF at the top of the script.Now I could get the Japanese text on the blue title bar. I hope you understand Jos, and sorry for the trouble... Edited January 29, 2009 by charvi
Developers Jos Posted January 29, 2009 Developers Posted January 29, 2009 Yes, I understand and know you need to do a save first or force the save by maning a small change before the encoding truely changes of the file. Glad its sorted out now! 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.
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