2

Java 18将指定UTF-8作为标准Java API的默认字符集

 2 years ago
source link: https://www.jdon.com/57152
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Java 18将指定UTF-8作为标准Java API的默认字符集

20 多年后Java终于将默认字符集更改为 UTF-8 ,可能存在重大风险,亚洲地区的 Windows 用户以及亚洲和其他地区的某些服务器环境可能会受到影响。

通过将 UTF-8 指定为默认字符集,依赖于默认字符集的 API 将在所有实现、操作系统、区域设置和配置中保持一致。

许多环境中的应用程序可以预期来自 UTF-8 的风险非常低。例如,MacOS 已将 UTF-8 作为其多个版本的默认字符集,多个Linux 发行版也使用 UTF-8。

但是还是会风险存在:

  • 在处理未指定新默认字符集时生成的数据时,应用程序可能无法正确运行。这种风险并不新鲜。
  • 亚洲地区的 Windows 用户

记录/数组的模式以及UTF-8字符集是Java 18两个特性JEP提案


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK