I have a file that has characters that will only be interpreted correctly if the file is read as UTF-8 (characters such as ü). However, it doesn't have the UTF-8 BOM byte header of 0xEF,0xBB,0xBF. The file is created by another program (via PostgreSQL queries requested by my script). When I read the lines from this file, the script doesn't recognize the extended characters correctly, but I have seen that they will be read correctly if the file has the UTF-8 BOM header.
So my question is: Is there a way to force my script to read a file as a UTF-8 file even if it doesn't have the UTF-8 BOM? That would allow me to avoid having to read the file contents and write them back out to a new file with the UTF-8 BOM. I would have to do this for each query that could potentially have these characters in them. Or is that really the only way to do it? It would just be better for performance to limit how much I'm reading and writing files if I could avoid that.
Get help with using AutoHotkey and its commands and hotkeys
4 posts • Page 1 of 1
Thanks. I'll try that.