我是靠谱客的博主 老迟到煎蛋,这篇文章主要介绍Java 编码规范 StandardCharsets.UTF_8 三个方法 toString() name() displayName(),到底用哪个方法更合适?...,现在分享给大家,希望可以做个参考。

想用StandardCharsets.UTF_8 返回"UTF-8"这个字符,测试一下,三个方法toString() name() displayName(),均能返回"UTF-8",到底用哪个方法更健壮?

public final String name()

Returns this charset's canonical(正式的) name.
=========================================
public String displayName()

Returns this charset's human-readable(便于人类可阅读的) name for the default locale.

The default implementation of this method simply returns this charset'

最后

以上就是老迟到煎蛋最近收集整理的关于Java 编码规范 StandardCharsets.UTF_8 三个方法 toString() name() displayName(),到底用哪个方法更合适?...的全部内容,更多相关Java内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(66)

评论列表共有 0 条评论

立即
投稿
返回
顶部