In my java server code name = request.getParameter("SUPERHERO.NAME") i am getting a series of boxes on my server side code.

where printing the variable name give me a series of boxes that becomes question marks However, when the page loads i am able to view the chinese characters on the page without a problem.

Was it helpful?


To solve the problem of un-recognized characters being shown as boxes in your code file (.java files), change the preferences of your editor so that the default encoding is UTF-8. This should solve your issue.

In case you are using Eclipse IDE, you can try the below steps :

1) Navigate to Windows -> Preferences -> General -> Content Types

2) Set UTF-8 as the default encoding for all content types.

3) Windows -> Preferences -> General -> Workspaces

4) Set "Text file encoding" to "Other : UTF-8".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top