I have a Unicode String as a sum of 6 substrings:
String unicode = '\\' + 'u' + '0' + '0' + 'e' + '4';
So is there any chance in flutter to decode it into a unicode String like that:
String unicodeString = '\u00e4';
Thanks a lot for your helping!
Yes, this can be easily done:
\u
String unicode = '\\u00e4';
var codepoint = int.parse(unicode.substring(2, 6), radix: 16);
String unicodeString = String.fromCharCode(codepoint);
print(unicodeString);
Also note that you can just write '\\u00e4'
. As it starts with a double backslash, this is indeed a string with 6 characters (and not equal to '\u00e4'
).