2

I have a problem, I can not convert my string from CP1252 to UTF-8, my string comes from a .DBF (Windows) file that is read by my PHP functions

  • My application is fully encoded in UTF8

My file .dbf is load with php-xbase

$table = new Table($file, null, "Windows-1252//TRANSLIT");

or

$table = new Table($file);

is not working my string return :

Ordures M‚nagŠres

I also tried to do this directly but it gives the same result:

echo iconv('CP1252', 'UTF-8', "Ordures M‚nagŠres");

Ordures M‚nagŠres

Do you have an idea of ​​where it can come from, knowing from php-xbase uses iconv to convert characters but it has no effect I lose the accents of letters...

Thank you for your help and sorry for my bad English

Node
  • 21
  • 3

1 Answers1

1

You should use the CP850 encoding when you work with DBF files if they come from MS-DOS FoxPro applications(International MS-DOS)

In the case of a Windows DBF file, like a DBF straight up from a Visual FoxPro application, you can use CP1252 (Windows ANSI)

gadget00
  • 301
  • 6
  • 18