I was trying to converting string UTF-8 to ANSI (Windows-1252).
Here is some examples of my codes:
Non of them doesn't work and polish characters has question marks or diamonts :/
The only solution for now is this library: CkCharset Converter but i don't want to use such a big library for saving one file.
I'll be grateful for any help with this problem.
The file with script has header like and encoding UTF-8:
header('Content-Type: text/html; charset=utf-8');
If by ANSI you mean the original ASCII encoding that only supports the English letters A-Z, you can use iconv with the
translit
option:If instead you mean Windows code page 1250, use:
If instead you mean DOS code page 852, use:
You should check which encoding your billing program expects. If it's a DOS program from the 80's, it's probably cp852, but if it's a Windows program from the 90's it's probably windows-1250.