-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] handling of UTF-16 and UTF-32 encoding #16
Comments
Good idea to detect the BOM. I have implemented it and released v0.16.0. The programming language Standard ML and the compiler I use currently have very limited support for Unicode. There is no library I know for working with encodings like UTF-16 and UTF-32 or detecting them using heuristics. This means opening a UTF-16 or UTF-32 file without the BOM will keep generating an "invalid line" error in the foreseeable future. There is also no way to pass Unicode command-line arguments to initool on Windows. I will keep this issue open in case the Unicode situation changes. |
I have just tested version 0.16.0 with a HCU-Test.reg using the encoding UTF-16 LE. Here are the results: C:>initool version C:>initool -p get HCU-Test.reg HKEY_CURRENT_USER\Test\subkey1 C:>echo %errorlevel% C:>initool -p get HCU-Test.reg HKEY_CURRENT_USER\Test\subkey1 """test_string""" C:>echo %errorlevel% C:>initool -p get HCU-Test.reg [ H K E Y _ C U R R E N T _ U S E R \ T e s t ] [ H K E Y _ C U R R E N T _ U S E R \ T e s t \ s u b k e y 1 ] [ H K E Y _ C U R R E N T _ U S E R \ T e s t \ s u b k e y 2 ] For the last command, I guess it should also return an errorlevel 1 |
Could you attach |
HCU-Test.reg.txt.zip |
Thanks. |
This was a bug in BOM detection. Thanks for reporting it. I have fixed the bug and released version 0.17.0, which includes other improvements. |
Thank you @dbohdan C:>initool.exe version C:>initool -p get HCU-Test.reg C:>echo %errorlevel% C:>initool -p get HCU-Test.reg HKEY_CURRENT_USER\Test\subkey1 C:>echo %errorlevel% C:>initool -p get HCU-Test.reg HKEY_CURRENT_USER\Test\subkey1 """test_string""" C:>echo %errorlevel% |
In follow-up of #15, a level of support of UTF-16 LE encoding will be desired.
A very first level, would be to recognize a file encoded in either UTF-16 or UTF-32 and to handle a specific error to instruct/advice the user to convert input file into a encoding supported by initool.
In inicomp tool, an error message is displayed with an instruction for the user.
"Error: File .................. is encoded as UTF16. Please convert it to ANSI or UTF8 first."
The text was updated successfully, but these errors were encountered: