Character encoding decides how letters are stored in a file as numbers. UTF-8 is today's standard and handles the special characters of every language – Slovak, Czech, Polish and even Greek. If a feed is saved in a different encoding from the one it declares or the channel expects, you'll see meaningless symbols instead of letters like "ž".
What is UTF-8 encoding
A computer doesn't actually know letters, only numbers. Encoding is a conversion table that says which number means which letter. It is like a cipher: if the sender encodes a message with one table and the recipient reads it with another, the text turns into a jumble of strange symbols.
There are many older tables – in Central Europe, windows-1250 and ISO-8859-2 were the most common. Each could handle only a few languages. UTF-8 contains the characters of every language in the world. Letters without accents take up one byte, letters with accents such as háček or acute two bytes, and other characters up to four.
What it looks like in a feed
<?xml version="1.0" encoding="UTF-8"?>
<SHOP>
<SHOPITEM>
<PRODUCTNAME>Spacák Horal Mumia 300 žltý</PRODUCTNAME>
</SHOPITEM>
</SHOP>The first line announces that the file is in UTF-8; if a program read it as windows-1250, it would see "Spacák Horal Mumia 300 Ĺľltý". A Google feed has the same header.
What it is used for
Every text file needs an encoding – XML, CSV and JSON alike. Google Merchant Center and Meta recommend UTF-8. If an XML file doesn't state its encoding in the header, the XML rules treat it as UTF-8; a file in any other encoding must therefore declare it in the header. CSV has no header at all, which is why it causes the most problems.
What to watch out for
- The header lies. The file claims
encoding="UTF-8"but is saved in windows-1250 – the accented characters break or the file can't be read. - CSV from Excel. Older versions of Excel save CSV in a Windows encoding, not UTF-8. When saving, choose "CSV UTF-8".
- Double conversion. If text is converted twice, you get strings like "ÄŤ" that can no longer be reliably repaired.
- Invisible characters. Control characters copied from other programs are forbidden in XML and can stop a feed from loading.
How Sortyra helps
Sortyra detects a source's encoding automatically – from the header for XML, and from the content for CSV without a header, including windows-1250. It writes all XML outputs in UTF-8 with the correct header.
Related terms
- XML
- CSV
- CDATA
- Feed
- More detail: Common feed errors and Feed types
Frequently asked questions
How do I find out a file's encoding?
For XML, look at the first line with encoding=. For CSV, open the file in Notepad – the encoding is shown in the status bar at the bottom.
Why do I see strange symbols instead of accented letters in Excel?
Excel opened the file in a different encoding from the one it was saved in. Load it via Data → From Text/CSV and choose UTF-8.
Is windows-1250 an error?
Not if it is correctly declared in the header and the channel supports it. UTF-8 is still the safer choice, accepted by almost all channels.