Skip to main content
🚨 重要提示

本项目目前仍处于早期开发阶段,核心功能尚未完全实现,语法规范和工具链仍在持续完善中。

Default Encoding in Different Programming Languages / Operating Systems

Programming Language / Operating SystemDefault Unicode EncodingSpace Occupancy
(Bytes)
Description
Python 3UTF-324 byteFixed-length encoding
Java, JavaScript, C#, Swift
Windows NT
UTF-162 / 4 byteVariable-length encoding.
Uses 2 bytes for BMP characters,
and 4-byte surrogate pairs for characters outside the BMP.
Node.js, Go, PHP, Rust, Ruby, Perl
Unix, Linux, macOS
UTF-81 - 4 byteVariable-length encoding
C / C++No fixed standard-Can use UTF-8, UTF-16, or UTF-32
note

Python 3 uses an internal encoding for storage and only converts to Unicode encoding during input/output. Therefore, strictly speaking, Python 3's default Unicode encoding should be "UTF-32 + internal encoding".