如何在Flutter中将以下值转换为有意义的值

huangapple go评论55阅读模式
英文:

How to convert the following value in meaningful value in Flutter

问题

I'm getting a response from Flask API like this:

"நம்பிக்கை வைக்கும் பேசும் உறவு வைக்கும் அன்பு தான் கிடைக்கும்"

but when I pass it through Flutter, it shows like some ASCII representation like this:

"\u0ba8\u0b9f\u0bc1\u0ba8\u0bbf\u0bb2\u0bc8 \u0b85\u0ba9\u0bcd\u0baa\u0bbf\u0ba9\u0bcd".

I tried to convert it in frontend but I couldn't convert it as I expected.

英文:

I'm getting a response from Flask API like this

"நம்பிக்கை வைக்கும் பேசும் உறவு வைக்கும் அன்பு தான் கிடைக்கும்"

but when I pass it through the Flutter It shows like some ASCII representation like this

"\u0ba8\u0b9f\u0bc1\u0ba8\u0bbf\u0bb2\u0bc8 \u0b85\u0ba9\u0bcd\u0baa\u0bbf\u0ba9\u0bcd".

I tried to convert it in frontend but I couldn't convert it as I expected

答案1

得分: 1

以下是翻译好的部分:

"The response you are seeing is the Unicode escape sequence representation of Tamil characters.

You can convert them to their corresponding Tamil characters using the dart:convert library:

 String unicodeResponse = "\u0ba8\u0b9f\u0bc1\u0ba8\u0bbf\u0bb2\u0bc8 \u0b85\u0ba9\u0bcd\u0baa\u0bbf\u0ba9\u0bcd";
 String decodedResponse = json.decode('"$unicodeResponse"');

decodedResponse 是您想要的有意义的值。"

英文:

The response you are seeing is the Unicode escape sequence representation of Tamil characters.

You can convert them to their corresponding Tamil characters using the dart:convert library:

 String unicodeResponse = "\u0ba8\u0b9f\u0bc1\u0ba8\u0bbf\u0bb2\u0bc8 \u0b85\u0ba9\u0bcd\u0baa\u0bbf\u0ba9\u0bcd";
 String decodedResponse = json.decode('"$unicodeResponse"');

decodedResponse is the meaningful value you want.

huangapple
  • 本文由 发表于 2023年4月17日 01:54:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76029449.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定