Character corruption of multi-byte string (java)

0 votes
Hi. It does not appear correctly in corrupted (e.g."????") If you specify a string of multi-byte user name in scoreBoardService.saveUserScore. 
Please tell me how to resolve.
asked Aug 8, 2014 in App42 Cloud API-BaaS by appwarp (20 points)

1 Answer

0 votes

Thanks for writing to us.

You can encode the username before saving it. Kindly find the below code snippet for encoding the user name in bytes for saving the user score. The below code snippet will resolve your issue.

String encodedBytes = Base64.encodeBytes("UserName".getBytes());

System.out.println("encodedBytes " + new String(encodedBytes)); 

Let us know if it helps.

answered Aug 10, 2014 by hs00105 (2,005 points)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...