Sign in to follow this  
Followers 0
leuce

_FileWriteToLine to a Unicode file

2 posts in this topic

G'day everyone

I'm trying to change a line in a file. The snag is that the file is a unicode file. The line I want to change does not contain any characters which do not occur in ASCII 255, but perhaps the fact that the file to write to is a Unicode file, has something to do with the fact that my _FileWriteToLine doesn't work. I've tried the following three options (that didn't work):

$prefsfile = FileOpen (@AppDataDir & "\OmegaT\omegat.prefs", 1)
_FileWriteToLine($prefsfile, 9, "<tab_advance>true</tab_advance>", 1)
FileClose($prefsfile)

$prefsfile = @AppDataDir & "\OmegaT\omegat.prefs"
_FileWriteToLine($prefsfile, 9, "<tab_advance>true</tab_advance>", 1)

_FileWriteToLine(@AppDataDir & "\OmegaT\omegat.prefs", 9, "<tab_advance>true</tab_advance>", 1)

The strange thing is, I could have sworn that the first one above did work on my Windows XP machine at the office. I'm using Windows 2000 at home, you see. Is this perhaps an OS issue?

Thanks!

Samuel

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I think autoit will always write in standard ASCII mode. Unicode is not directly supported (maybe a UDF is out there somewhere). Like I said another post, you'll proabally have to do Raw file i/o untill somthing mor elaquant is available

Edit: made some fucntions you may find usefull...at least give you some ideas...check http://www.autoitscript.com/forum/index.php?showtopic=30149

Edited by evilertoaster

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  
Followers 0