Pregunta

everybody,

I am trying to create my own XML import script but I have problem with character "š,č,ř,ě". My script look like this:

$xml = simplexml_load_file("test.xml");
$products = $xml->SHOPITEM;
$options = $products->VARIANT->var; 
$product_name = $products->PRODUCTNAME)
var_dump($product_name);
exit();

When I dump $product_name the result looks like this: "FIRST CLASS šedĂ©". As you can see character where is "ěščřžýáíí" is broken.

Thank you for help.

¿Fue útil?

Solución

To post as an answer - thats just a browser selecting a wrong encoding. All the characters returned are correct but the browser shows them with a wrong encoding. Try changing browser encoding or adding header("Content-Type: text/html; charset=utf-8"); before var_dump()

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top