• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Convert special characters to readable ones

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am getting an error, which says The character '' is an invalid character. Actually i am trying to create an xml from the data that comes from the database. In that data this character is there and it is not accepting this.

The data comes from a different language. I tried using UTF-8 and ISO-8859-1 for the encoding, but didnt get resolved.

I need to convert this character so that xml can handle that.

Please let me know for any solution.
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the encoding that the database uses and what is the encoding that the target XML file should use ?
 
Pavan Kashyap
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure of the encoding on the database side, from the xml side i am currently using "UTF-8" for encoding
 
Sheriff
Posts: 28327
96
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
It looks like your character is U+0008, or hex-08 if you like. This character is not permitted in any XML document, so what you have there is not a well-formed XML document. Encoding doesn't have anything to do with it.

You are producing this document from a database? Then you will have to filter out invalid characters before writing the others to the document. And you will need to know which characters are permitted and which ones aren't. The XML Recommendation tells you that; section 2.2 is the part you should particularly read.
 
And will you succeed? Yes you will indeed! (98 and 3/4 % guaranteed) - Seuss. tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic