Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

下面哪段程序能够正确的实现了GBK编码字节流到UTF-8编码字节流的转换: byte[] src,dst; #61

Open
waylau opened this issue Jul 4, 2020 · 0 comments

Comments

@waylau
Copy link
Owner

waylau commented Jul 4, 2020

下面哪段程序能够正确的实现了GBK编码字节流到UTF-8编码字节流的转换: byte[] src,dst;(2分)

A. dst=String.fromBytes(src,"GBK").getBytes("UTF-8")
B. dst=new String(src,"GBK").getBytes("UTF-8")
C. dst=new String("GBK",src).getBytes()
D. dst=String.encode(String.decode(src,"GBK")),"UTF-8" )

你的回答D 是错误的,估计是B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant