My app fetches data from TikTok through a Api. The username and caption of some TikToks contains some special characters and fonts like: 𝒦ℋ𝒜ℒℰ𝒟 and some contains text in other languages. When I tested the Api on its website it show the data correct
but when I get that data through my app it changes the special characters and language to something like this
Ðе ÑоÑела игÑаÑÑ Ñ Ð±Ð°ÑниÑÑом ÐÐµÐ»Ð¸ÐºÐ¾Ð»ÐµÐ¿Ð½Ð°Ñ ÑкÑипаÑка!
and other values or links that is in english dose not change
The code am using is
Map<String, String> headers = {
"X-RapidAPI-Host":
"tiktok-downloader-download-tiktok-videos-without-watermark.p.rapidapi.com",
"X-RapidAPI-Key": "-------------------------------",
};
final body = {'url': url};
final uri = Uri.https(
"tiktok-downloader-download-tiktok-videos-without-watermark.p.rapidapi.com",
'/vid/index',
body);
final response = await http.get(
uri,
headers: headers,
);
if (response.statusCode == 200) {
var data = jsonDecode(response.body);
print(data['description'][0]);
}
The Api am using
https://rapidapi.com/maatootz/api/tiktok-downloader-download-tiktok-videos-without-watermark
2
Answers
As I’ve tested your strings in live demo of TextField, Its showing me perfectly. I think you may have to checked it by copy/paste same string in your TextField.
Here is the output
Here is the link to test it by yourself: https://docs.flutter.dev/cookbook/forms/text-input
Tryout with simple TextField widget first if you are using any custom widget.
If it is only a display issue, you might be using a font which does not have Glyphs for the languages you are trying to display. Try changing your app font to something which is widely used and covers most of the languages like
Roboto
. You can go to Google fonts, choose a font and copy/paste your text e.g. This is how your text will appear with RobotoTo add Google fonts to your App you can use google_fonts package
If it is not display issue rather on API side then make sure the API is working with proper mime and file types e.g. UTF8