

(Note that the locale may be different from the Windows display language). Then choose "Change system locale." (you need administrative privilege for this).

Then you should see "Current language for non-Unicode programs". Other system locales may interpret 0xFE differently depending on which pre-Unicode encoding suited their language.įrom Settings, find Time & language > Language & region > Administrative language settings. In ISO-8859-1 code page layout, you see that þ is placed exactly where you expect ţ in ISO-8859-2. If the Windows system locale is English (United States), an "ANSI" text file is loaded like ISO-8859-1, so that you can see þ even in a non-Unicode program.If you look at ISO-8859-2 code page layout, there is no "thorn" letter.īasically, the pre-Unicode encoding for Romanian (or another similar language) does not support the þ character. If the Windows system locale is Romanian (Romania), an "ANSI" text file is loaded like ISO-8859-2, so the 0xFE byte is loaded as ţ (not thorn, but rather "t with a cedilla").However, in Windows, a text file in the so-called "ANSI" ( non-Unicode) is loaded differently depending on your system locale:

If you can check hex dump, you can verify that FE is there (it only takes one byte). Windows-1252 is the same as ISO-8859-1 except for 0x80 to 0x9F. Your þ will be saved as 0xFE (numeric value: 254). Assuming your php file is in utf8, then the following saves the "þ" in Windows-1252 encoding: $text = iconv('UTF-8', 'Windows-1252', 'þ') įile_put_contents('./output.txt', $text)
