How to import special characters from a JSON file data source?

Erik Schreurs
Tera Expert

Hi everyone,

I'm trying to import some data from a JSON file. I configured a data source and added a JSON file attachment. Everything seems to work fine, except that special characters (such as Ä and Ø) are not properly imported. Instead, it turns it into these unicode symbols: 

find_real_file.png

The issue already occurs before running any transforms.
I have already tried the following things:

  • Setting the field in the import table to be a String (Full UTF-8) field (doesn't make a difference)
  • Set properties field of the data source to charset=UTF-8 (doesn't work for JSON imports, only CSV)


Is there any way to properly load special characters from a JSON file import?
Since the data file is coming from an external source, using a different filetype isn't really possible and they also don't have any API technology in place whatsoever, so we're pretty much forced to stick with the JSON file import.

 

Any help would be appreciated, thanks in advance!

1 ACCEPTED SOLUTION

Turned out that my source file was indeed not properly UTF-8 encoded. I downloaded the file, re-saved it with UTF-8 encoding and this time it imported everything perfectly.

Thanks!

View solution in original post

3 REPLIES 3

Isaac Vicentini
Mega Sage
Mega Sage

Hi,

It may be that the chatset properties must be configured from the source, however it is possible to do a post-treatment using decodeURIComponent:

 

var yourJSON = "F?B?DBERGET";

var formattedText = decodeURIComponent(yourJSON);

gs.info(formattedText);


Best regards,

Isaac Vicentini
MVP 2025


If my answer was helpful, mark it as Helpful or Accept as Solution.

Rogers Cadenhe1
Giga Guru

Put the text into a charset encoding tool such as the one at Webatic to confirm that your data is really UTF-8 instead of another charset such as ISO-8859-1 or windows-1252.

Turned out that my source file was indeed not properly UTF-8 encoded. I downloaded the file, re-saved it with UTF-8 encoding and this time it imported everything perfectly.

Thanks!