Created
November 2, 2019 15:00
-
-
Save HelgeSverre/94b3febd063256dd8b0445a698fb0c22 to your computer and use it in GitHub Desktop.
utf8 decode error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'dart:typed_data'; | |
void main() { | |
var name = "A string containing ø"; | |
var bytes = Uint8List.fromList(name.codeUnits); | |
var decoded = json.decode(utf8.decode(bytes)); | |
print(decoded); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment