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".