We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › newbie: Converting strings and character encodings
Page Index Toggle Pages: 1
newbie: Converting strings and character encodings (Read 359 times)
newbie: Converting strings and character encodings
Oct 31st, 2006, 6:31am
 
Hi,

is there a way in processing to convert a string like the following:

John’s

back to what it should look like, as a quotation mark:

John's

I reckon this is a character encoding issue, but I can't seem to be able to convert it using the getBytes() function to translate a string from one encoding to another - all I got after converting it was John???s in the output window.

These strings that I am trying to convert are elements pulled from XML RSS feeds, so I'm guessing they should be UTF-8 encoded. The proXML library I'm using however does not seem to have a way to identify what character set the xml file is though.

I have tried, after pulling the string from proXML, to convert it from ISO-8559-1 and UTF-8 in both directions, and nothing is working for me right now.

Also, I am wondering how to convert the special characters ( those & apos; lt, quot characters) back into their intended form for text display. Is searching for and replacing the substrings with the actual character the best way to deal with this?

I'm really new to this Java language and would like some help in the right direction.

Thanks!
Page Index Toggle Pages: 1