Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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!

share|improve this question
1  
Which program are you viewing the XML file in? Does the XML file report an encoding in its <?xml ?> header? –  Bendoh Sep 11 '12 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 Sep 12 '12 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 Sep 12 '12 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 Sep 12 '12 at 0:20
    
Swell. Thanks :) –  Bendoh Sep 12 '12 at 1:05

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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