Hey
I need to validate if the provided byte stream is UTF-8.
I need help with start and programming logic. I could accept file which would have byteStream or i could use Scanner and they would input the byteStream. We don't know how long the byte stream is.
I need to make sure that bytestream is UTF-8 validated.
This is security problem. I would take in a stream byte. And I would have to check it if its valid UTF-8. There is some way to do that. Probably i would need to go byte by byte or bit by bit to see its valid UTF-8 format. The main logic is to not to accept anything else then UTF-8, and if it does encounter something thats not UTF-8, then say, "NOT Valid Stream"
Any help is appreciated...
Thank You
UTF-8 Byte Stream
Page 1 of 11 Replies - 1571 Views - Last Post: 15 October 2010 - 12:37 PM
Replies To: UTF-8 Byte Stream
#2
Re: UTF-8 Byte Stream
Posted 15 October 2010 - 12:37 PM
You can force a Scanner to accept a specific encoding:
Scanner scan = new Scanner(file_or_string_object, "UTF-8");
Page 1 of 1

New Topic/Question
Reply
MultiQuote






|