• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jsoup: Handling Non-Unicode Characters

 
Ranch Hand
Posts: 193
14
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do your logs have that line break in the middle of the url there?
 
Simon Ritchie
Ranch Hand
Posts: 193
14
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, I added that break as I didn't want to mess with the page dimensions on here.
 
Marshal
Posts: 28176
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic