String.getBytes()方法中的中文编码问题

String.getBytes()方法中的中文编码问题-java认证-认证考试-网页教学网

String的getBytes()方法是得到一个字串的字节数组,这是众所周知的。但特别要注意的是,本方法将返回该操作系统默认的编码格式的字节数组。如果你在使用这个方法时不考虑到这一点,你会发现在一个平台上运行良好的系统,放到另外一台机器后会产生意想不到的问题。

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *

What is 15 + 5 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)