• Post Reply Bookmark Topic Watch Topic
  • New Topic

Jsoup: Handling Non-Unicode Characters  RSS feed

 
Simon Ritchie
Ranch Hand
Posts: 134
4
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I've written an application that uses the Jsoup JARs to parse HTML pages containing the results of soccer matches.  It's working fine except when the code attempts to open a URL that contains a non-unicode character, specifically the accented E in the French language: É.

I've traced the error to this line of code



The url parameter is the following link:  http://www.scorespro.com/soccer/livescore/as-saint-Étienne-vs-stade-rennais/27-10-2012/

This is the stack trace:



Does anyone know how I can resolve this?

Thanks in advance.
 
Dave Tolls
Ranch Foreman
Posts: 3056
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do your logs have that line break in the middle of the url there?
 
Simon Ritchie
Ranch Hand
Posts: 134
4
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I added that break as I didn't want to mess with the page dimensions on here.
 
Paul Clapham
Sheriff
Posts: 22823
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That URL should be URL-encoded before trying to use it to connect to the corresponding web location. Yes, it's code which is beyond your control which should be doing that but perhaps it's not properly URL-encoded in the page which contains it. Could you have a look and see if that's the case?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!