• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Error while parsing html page in java on linux  RSS feed

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am parsing HTML page using some html parsing utility. i am using cobra.jar and js.jar for that.

There are some unreadable special charactor like ' � ' but when I compiled my program in windows it compile properly and run fine.

But when i compiled it in linux it gives me followig Warning:
unmappable character for encoding UTF8
String stateZipArray[] = stateZip.trim().split(" � ");

and then while accessing elements from stateZipArray array it gives ArrayIndexBounds exception.

In InputStreamReader class i am using 'ISO-8859-1' as a charsetname.

Can any one please tell me what is problem and how can i resolve it?

Thanks in advance.
 
author
Posts: 3281
7
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you're mixing and matching your encoding types. Try using UTF-8 in your InputStreamReader and also read this article
 
Rahul Dhaware
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried using UTF-8 in constructor of InputStreamReader.
It it not works. it gives me same error.
 
Martijn Verburg
author
Posts: 3281
7
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the article link I posted? It gives you vital understanding of these sorts of problems...
 
How do they get the deer to cross at the signs? Or to read this tiny ad?
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!