4

How convert PHP value from windows-1257 to UTF-8? I tried many ways, but they was not successful. I have lttu�s and I wanna convert this to littūs.

utf8_encode(); 
iconv_set_encoding("windows-1257", "UTF-8");
mb_convert_encoding()

Doesn't work. :(

Can anybody help me?

simple
  • 10,723
  • 3
  • 17
  • 11
  • What's the character you have? From what I can see, U0168 doesn't exist in Windows-1257 http://www.fileformat.info/info/unicode/char/0168/charset_support.htm – Peter Bailey Mar 30 '10 at 17:51

3 Answers3

9
$encoded= iconv ("CP1257","UTF-8", $string)
Jonathan.
  • 53,997
  • 54
  • 186
  • 290
Eds
  • 91
  • 1
  • 2
4

Use mb_convert_encoding($data, 'UTF-8', 'ISO-8859-13');

Mārtiņš Briedis
  • 17,396
  • 5
  • 54
  • 76
Nidhi Kaushal
  • 299
  • 4
  • 15
0

Have you checked that the page you are using to display the converted string has the Encoding and CodePage set correctly?

Vishal Seth
  • 4,948
  • 7
  • 26
  • 28