Search code examples
unicodewindows-7notepadutf-32

Can Notepad read UTF-32?


These bytes represent the word "hi" in UTF-32LE:

FF FE 00 00 68 00 00 00 69 00 00 00

However this is what Notepad displays:

enter image description here


Solution

  • Notepad does not support UTF-32, only ANSI, UTF-8, and UTF-16. It is interpreting the first 2 bytes as a UTF-16LE BOM, not the first 4 bytes as a UTF-32LE BOM, so the file bytes get interpreted as

    FF FE 00 00 68 00 00 00 69 00 00 00

    Instead of

    FF FE 00 00 68 00 00 00 69 00 00 00