Linux Posted June 27, 2008 Share Posted June 27, 2008 (edited) 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 June 27, 2008 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 More sharing options...
ChrisL Posted June 27, 2008 Share Posted June 27, 2008 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) [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Linux Posted June 27, 2008 Author Share Posted June 27, 2008 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 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