1

I have a Wordpress installation with MySQL encoded as utf8_general_ci. I'm trying to export it using wordpress' export tool, but the result XML breaks some special characters such as "é", "ê", etc turning them into "é" for example.

The XML file is being downloaded into a Windows machine and scp'ed into a Linux. In both platforms the encode is off.

I checked the resulting xml with "file" and it´s telling me it is a UTF8 file.

What am I missing?

Thanks!

4
  • 1
    Which program are you viewing the XML file in? Does the XML file report an encoding in its <?xml ?> header?
    – Bendoh
    Commented Sep 11, 2012 at 23:55
  • Good question! I'm looking at it with cat/vi/vim in Linux and also in Windows and that´s where I see it wrong. If I use Notepad++, for example, in Windows the characters are showed correctly. Also, it has the xml header with encoding set to UTF-8: <?xml version="1.0" encoding="UTF-8" ?>. Looks like my problem is with Linux based editors?
    – tucaz
    Commented Sep 12, 2012 at 0:03
  • The file is likely correct, but the program that you're viewing it in is probably interpreting it with ISO-8859-1 / latin1 encoding. The "é" pairing is something I have often seen when viewing a UTF-8 encoded 'é' in latin1.
    – Bendoh
    Commented Sep 12, 2012 at 0:08
  • I added set encoding=utf-8 to my .vimrc and it made the trick. Thanks a lot! (@Bendoh if you answer the question I can mark it as yours)
    – tucaz
    Commented Sep 12, 2012 at 0:20

1 Answer 1

0

The file is likely correct, but the program that you're viewing it in is probably interpreting it with ISO-8859-1 / latin1 encoding.

The é pairing is something I have often seen when viewing a UTF-8 encoded é in latin1.

Be sure that the program you are viewing the file in is set to view in UTF-8 encoding.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.