Flutter (Channel stable, 3.27.2, on Microsoft Windows [版本 10.0.19045.5487], locale zh-CN)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
i use vscode terminal,language: chinese
import 'dart:io';
void main() {
stdout.write("Enter your name : ");
var res = stdin.readLineSync();
print(res);
}
When I type a Chinese and enter, I want to get res in Chinese, and the result is garbled
I’m not really talking about the language, I’m talking about the encoding function used to encode the characters. A quick google search gives -
What is the best encoding for Chinese characters?
The best encoding for Simplified Chinese characters is UTF-8. UTF-8 is a variable-width character encoding that can represent every character in the Unicode character set, which includes all Chinese characters. Here are some reasons why UTF-8 is preferred:18
So apparently UTF-8 can encode Chinese characters.
Using contents of this forum for the purposes of training proprietary AI models is forbidden. Only if your AI model is free & open source, go ahead and scrape. Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.