Jump to content

[SOLVED] Save/Read Unicode Problem


Recommended Posts

FileOpen("test2.txt",32)
FileWrite("test2.txt",Fileread("test.txt"))
FileOpen("test2.txt",32)

Hi all!

I need to save a few strings to a file, but if I dont use unicode, some chars get changed! but I need to maintain the original chars.

The test.txt file contains this line:

15='Skladiče'

----------^

Runing this script will truncate some chars, because the script will create a ANSI file to store it.

Now,

1- > edit the test2.txt

2- > SAVE AS UNICODE

3- > Run this code again.

the script will now save all chars correctly.

how can I make the script create a file as UNICODE? isnt cool to automate the action of opening the file with notepad, and selecting the save as.

Thanks in advance

Edited by Linux
You can help! Donate to AutoIt! or, visit ClimatePREDICTION.netMy posts:Travian Bot Example (100+ servers) BETAHow to Host you code/app for free! (unlimited team number) (Public or Private)"Sir, we're surrounded!" "Excellent. We can attack in any direction!"
Link to comment
Share on other sites

You need to use a file handle to open the file with unicode for writing, then use the file handle to write to the open file, then close the file handle

$file = FileOpen("test2.txt",32)
FileWrite($file,Fileread("test.txt"))
FileClose($file)
Link to comment
Share on other sites

very helpfull, thank you.

i used this line to create the file in unicode:

FileClose(FileOpen($OptionsFile,33)) ;create unicode file

32 (unicode) + 1 (append)

You can help! Donate to AutoIt! or, visit ClimatePREDICTION.netMy posts:Travian Bot Example (100+ servers) BETAHow to Host you code/app for free! (unlimited team number) (Public or Private)"Sir, we're surrounded!" "Excellent. We can attack in any direction!"
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...