Jump to content
Sign in to follow this  
gil900

Characters in another language are destroyed and become to something else

Recommended Posts

gil900

Hello..

i have a strage problem with HEB Characters and this is prevents me to create folders that written in Hebrew.

i thing that it is happen if the $Variable Created within other function and set to be globally (global).

this is what it it should be:

D:גיבוייםעבודותהמרת הקלטותTestsניסיוןקלטת ניסיון

and this is what it was became:

D:׳’׳™׳‘׳•׳™׳™׳׳¢׳‘׳•׳“׳•׳×׳”׳׳¨׳× ׳”׳§׳׳˜׳•׳×Tests׳ ׳™׳¡׳™׳•׳קלטת ניסיון

this Line Is built as follows:

$ConversionTargetDir&""&$TapeName&""

the $ConversionTargetDir is = D:׳’׳™׳‘׳•׳™׳™׳׳¢׳‘׳•׳“׳•׳×׳”׳׳¨׳× ׳”׳§׳׳˜׳•׳×Tests Or D:גיבוייםעבודותהמרת הקלטותTests

and this is the global $Variable that created in another function by IniReed().

the $TapeName is not a global and created by GUICtrlRead()

i don't know why it is happaning..

Maybe it is fail in the inireed() function ?

Please help me

Edited by gil900

Share this post


Link to post
Share on other sites
BrewManNH

INI files are not Unicode compatible. If you need to use Unicode in an ini file, you have to create the file first and saving it as UTF-8 with BOM. You could do a FileOpen("yourinifile.ini", $FO_UTF8 + $FO_OVERWRITE), then close the file, this will create a file with a UTF-8 BOM. This is untested, but should work.


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 Gude
How 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

Share this post


Link to post
Share on other sites
gil900

INI files are not Unicode compatible. If you need to use Unicode in an ini file, you have to create the file first and saving it as UTF-8 with BOM. You could do a FileOpen("yourinifile.ini", $FO_UTF8 + $FO_OVERWRITE), then close the file, this will create a file with a UTF-8 BOM. This is untested, but should work.

ok thanks i did it but now it can't reed the ini settings...

it is It always Return me Failure case ("Returns the default string if requested key not found.")

the key always not found..

Share this post


Link to post
Share on other sites
BrewManNH

Post a copy of a runnable script that shows the error. I need it to be runnable because I may not be doing it the same way you are and this shortens the trouble shooting process.


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 Gude
How 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

Share this post


Link to post
Share on other sites
gil900

Post a copy of a runnable script that shows the error. I need it to be runnable because I may not be doing it the same way you are and this shortens the trouble shooting process.

this is very big script with About 520 lines ..

And to test it you need to run the software that the script working on and you need FFmpeg.exe in the same folder. Otherwise the script will not want to work.

And the script is written in Hebrew( the GUI) .. This story give someone else to check it .. :wacko:

Do you want me to isolate the problem and send a small code with the problem?

Edited by gil900

Share this post


Link to post
Share on other sites
BrewManNH

Doing a little more research, try replacing the $FO_UTF8 with $FO_UTF16_LE when you create the file and see if that has any effect.

Otherwise, I'd need to see how you're creating, reading, and writing to the file to make sure we're going about it the same way. It doesn't need to be anything fancy, just a small script that reads and writes to the INI file the same way your larger script is doing 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 Gude
How 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

Share this post


Link to post
Share on other sites
gil900

Doing a little more research, try replacing the $FO_UTF8 with $FO_UTF16_LE when you create the file and see if that has any effect.

Otherwise, I'd need to see how you're creating, reading, and writing to the file to make sure we're going about it the same way. It doesn't need to be anything fancy, just a small script that reads and writes to the INI file the same way your larger script is doing it.

In fact, I did not create the txt files in the way you describe because it did not work.

I created the udf8 txt file with windows ..

Your way brings me an error:

FileOpen ("yourinifile.ini", $FO_UTF16_LE + $FO_OVERWRITE)

FileOpen ("yourinifile.ini", ^ ERROR

Edited by gil900

Share this post


Link to post
Share on other sites
BrewManNH

You need to include the FIleConstants.au3 file in your script.


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 Gude
How 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

Share this post


Link to post
Share on other sites
gil900

You need to include the FIleConstants.au3 file in your script.

Now it works!! (with the udf16)

My the script open the folder that i wanted in a path that contains Hebrew folders!

Can I ask why I should have to deal with it?

Why does a man who wrote the function inireed() not Planned that this function will support other letters in the default UDF ?

Share this post


Link to post
Share on other sites
BrewManNH

It's not AutoIt, INI files by definition are not Unicode compatible, you have to tweak them to get them to accept Unicode. It's a Windows thing that's been there since Windows NT 3 or 4, which is why INI files are deprecated and XML is the latest standard, because XML is Unicode compatible.

Fortunately for me, I don't have to worry about Unicode because I write in English, but I will definitely be thinking about this in the future because Unicode should be the norm. Unfortunately, for me, I can't quite wrap my head around XML yet. :)


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 Gude
How 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

Share this post


Link to post
Share on other sites
gil900

ok thanks for the answer.

Is there also a function for XML that can reed and write things?

Share this post


Link to post
Share on other sites
BrewManNH

There's a UDF in the Example scripts section that should work, I've never used it myself but it seems popular.


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 Gude
How 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

Share this post


Link to post
Share on other sites
BrewManNH

BTW, in case anyone is interested, here's a quick method of ensuring your ini file can be used with Unicode characters.

#include <FileConstants.au3>
FileClose(FileOpen("IniFile.ini", $FO_UTF16_LE + $FO_OVERWRITE))

This will create the ini file using UTF-16 Little Endian with BOM by opening and immediately closing the file, which will write it without having to keep track of the file handle.


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 Gude
How 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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×