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) ??
Open and save text file in proper encoding Topic is solved
Re: Open and save text file in proper encoding
If you do not know the original encoding of the file then noone does - it's not stored anywhere.
You could check for the UTF-8 BOM and check if there are any characters that break the UTF-8 rule though.
You could also write an analasys that analyses the raw data and decides on a specific encoding.
You could check for the UTF-8 BOM and check if there are any characters that break the UTF-8 rule though.
You could also write an analasys that analyses the raw data and decides on a specific encoding.
Recommends AHK Studio
Re: Open and save text file in proper encoding
An example of getting the encoding by jNizM.
Check if middle-length hyphen exist in a word. - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 82#p133482
Check if middle-length hyphen exist in a word. - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 82#p133482
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Open and save text file in proper encoding
It was so frrrackin simple - my code works as it should.
Who is online
Users browsing this forum: Google [Bot], RandomBoy and 172 guests