Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Converting &characters to character equivalent  RSS feed

 
Mark Jones
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have some fielded content which stores all special characters e.g. ' as &rsquo etc. I want to convert these back to the display character i.e. '. Is there any easy way of achieving this.

Thanks
Mark
[ August 31, 2006: Message edited by: Ernest Friedman-Hill ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I edited your message so that the $amp;rsquo; shows up as you originally intended.

There are doubtless many third-party tools which do this for you, although I can't name one offhand. Maybe someone can recommend something.

You could do this yourself using regular expressions to find the HTML entities and a table of substitution chracters that you set up ahead of time; are you familiar with regular expressions?
 
Mark Jones
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whoops, forgot about those characters rendering! Thank you.

Yes, I am familiar with them however I thought I might be able to grab one "off-the-shelf" to do what I want".

If I don't receive a response looks like I will have no choice!

Thanks for your help.

Mark
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!