Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Detect charachter Encoding with java

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need your help, please?

I have an example wich is working very fine. with this example (see code below) I can detect the encoding of file using universaldetector framework from mozilla.

But I want that this example detect the encoding of input and not of the file for Example using class SCANNER? how can i modify the code below to detect the encoding of input instead of file?

Thanks in advance...
 
Marshal
Posts: 75686
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

I don't think you can detect encoding with a Scanner. You can instruct a Scanner to use a particular encoding with its constructors, and some of the better‑known encoding are specified in the Charset class, but I do not think you can instruct a Scanner to detect an encoding from the input. You can read more about encodings written by Joel Spolsky.
 
Good night. Drive safely. Here's a tiny ad for the road:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic