0

I have a simple problem. I am using iconv to convert UTF-8 to LATIN 2 liek this

$res = file_put_contents($edi_path, iconv('utf-8', 'CP852', $html));

but the output file is win 1250 or by php detected as ISO and special characters are not interpreted correctly, so i tried to open it in PSPAD save as Latin 2, close it, and open again it works fine and everything looks good.

So problem is in my PHP code, any advice?

halfer
  • 19,824
  • 17
  • 99
  • 186
user3175393
  • 109
  • 1
  • 10

1 Answers1

0

Try

iconv("UTF-8","Windows-1250", $html);

Default encoding of browser depends on your regional settings in system. You must consider what setting have your PC and server. In IE for example you can choose coding from right click of mouse. Windows migrated from CP852(DOS) to CP-1250 (Windows CE).

Kamil
  • 431
  • 1
  • 4
  • 16