在java中如何将utf8转为unicode的格式?

tridust 2002-02-19 03:25:14
谢谢
...全文
684 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
skyyoung 2002-02-20
  • 打赏
  • 举报
回复
new String(utf8.getByte("utf-8"),"unicode"); 这个就可以了吗。

录自logica smpp lib api . 定义中文短信的格式编码。

shmilu@sina.com
tridust 2002-02-20
  • 打赏
  • 举报
回复
to 路人甲:能不能给个例子,帮人帮到底吗。另外上面的那段是从哪里摘录的? 多谢!
tridust 2002-02-19
  • 打赏
  • 举报
回复
UTF 是Unicode/UCS Transformation Format,怎么会是unicode呢?
unicode是统一的两字节编码,而utf8是不等幅编码,英文字母为一个字节,
汉字是三个字节一个字。
skyyoung 2002-02-19
  • 打赏
  • 举报
回复
// Sixteen-bit Unicode Transformation Format, big-endian byte order
// with byte-order mark
public static final String ENC_UTF16_BEM = "UnicodeBig";
// Sixteen-bit Unicode Transformation Format, big-endian byte order
public static final String ENC_UTF16_BE = "UnicodeBigUnmarked";
// Sixteen-bit Unicode Transformation Format, little-endian byte order
// with byte-order mark
public static final String ENC_UTF16_LEM = "UnicodeLittle";
// Sixteen-bit Unicode Transformation Format, little-endian byte order
public static final String ENC_UTF16_LE = "UnicodeLittleUnmarked";
// Eight-bit Unicode Transformation Format
public static final String ENC_UTF8 = "UTF8";
// Sixteen-bit Unicode Transformation Format, byte order specified by
// a mandatory initial byte-order mark
public static final String ENC_UTF16 = "UTF-16";
yanchang 2002-02-19
  • 打赏
  • 举报
回复
同意楼上的 观点
不用转
pengji 2002-02-19
  • 打赏
  • 举报
回复
UTF8难道不是unicode吗!?
yangjf 2002-02-19
  • 打赏
  • 举报
回复
new String(utf8.getByte("utf-8"),"unicode");

基本上是这样,
不过我觉得utf-8本身就是一种unicode类型啊。
remote_roamer 2002-02-19
  • 打赏
  • 举报
回复
使用String.getBytes和new String()的方法

23,404

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧