How to fix the garbled characters in the character data

If you import data, sometimes you see the character data is garbled like the following. This is because the character encoding of the original data is different from “UTF-8” that Exploratory expects.

You can fix it by converting the character encoding using the iconv function. Here is how.

  1. Check the original data encoding. You can check the database setting if the data is from the database, or you can check the file if you import from a file. In this example, I know it is “Shift_JIS”.

  2. From the column header menu, choose “Create Calculation” → “Standard”.

  1. Type in the following comment in the Calculation Editor. Make sure to set the original encoding name for the from parameter. The to parameter should be always UTF-8.
iconv(Status, from="Shift_JIS", to="UTF-8")

It will create a new column with the converted data. If it doesn’t work, probably the original encoding is incorrect. Try a different encoding.

1 Like