Open and save text file in proper encoding
Posted: 22 Feb 2018, 05:20
I'm working on little editor that change few values in txt file.
Opening with FileRead, jobfile, %path%
changing with StringReplace, jobfileready, jobfile, %changethis%, %changetothat%
Saving with FileDelete, %path% and FileAppend, %jobfileready%, %path%
But i've noticed that when in source jobfile are local characters then saved file is messed up and later it doesn't work where it should. Otherwise everythig works smoothly.
How to open and save keeping the original encoding (i'm not sure if it is ANSi or UTF-8) ??
Opening with FileRead, jobfile, %path%
changing with StringReplace, jobfileready, jobfile, %changethis%, %changetothat%
Saving with FileDelete, %path% and FileAppend, %jobfileready%, %path%
But i've noticed that when in source jobfile are local characters then saved file is messed up and later it doesn't work where it should. Otherwise everythig works smoothly.
How to open and save keeping the original encoding (i'm not sure if it is ANSi or UTF-8) ??