Converting byte array to String (Java)

前端 未结 7 1086
不知归路
不知归路 2020-11-28 06:29

I\'m writing a web application in Google app Engine. It allows people to basically edit html code that gets stored as an .html file in the blobstore.

I\

7条回答
  •  旧时难觅i
    2020-11-28 07:03

    The previous answer from Andreas_D is good. I'm just going to add that wherever you are displaying the output there will be a font and a character encoding and it may not support some characters.

    To work out whether it is Java or your display that is a problem, do this:

        for(int i=0;i

    Java will have mapped any characters it cannot understand to 0xfffd the official character for unknown characters. If you see a '?' in the output, but it is not mapped to 0xfffd, it is your display font or encoding that is the problem, not Java.

提交回复
热议问题