Win a copy of Getting started with Java programming language this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

decoding unicode  RSS feed

 
Carey Brown
Saloon Keeper
Posts: 2441
33
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this encoded string:
I expanded the %__ encodings like this

The problem that I'm running into with the example string is that %C3%BA is not two ASCII characters but one UTF-8 character (lower u acute). I'm not clear on how to modify my decoder to handle this case. Any suggestions? Does Java have a decoder method somewhere in its library that would convert this properly?

 
Tim Moores
Saloon Keeper
Posts: 3409
72
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That looks like URL encoding - check out the java.net.URLEncoder and java.net.URLDecoder classes.
 
Carey Brown
Saloon Keeper
Posts: 2441
33
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With a UTF-8 char  set that did the trick. Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!