# _FileWriteToLine to a Unicode file

## Recommended Posts

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)
FileClose(\$prefsfile)```

```\$prefsfile = @AppDataDir & "\OmegaT\omegat.prefs"

`_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 on other sites

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

## Create an account

Register a new account