Unescape xml element content

J

Jon Stenqvist

Is there a way to unescape this string?

<name>Lätt B bed. Två omgångar A:0 och A:0</name>
 
A

Axel Etzold

-------- Original-Nachricht --------
Datum: Fri, 11 Jul 2008 21:37:30 +0900
Von: Jon Stenqvist <[email protected]>
An: (e-mail address removed)
Betreff: Unescape xml element content
Is there a way to unescape this string?

<name>Lätt B bed. Två omgångar A:0 och A:0</name>
Dear John,

require "CGI"
p CGI.unescapeHTML("<name>Lätt B bed. Två omgångar A:0 och A:0</name>")

should do it.

Best regards,

Axel
 
M

matt neuburg

Jon Stenqvist said:
Is there a way to unescape this string?

<name>Lätt B bed. Två omgångar A:0 och A:0</name>

I think this works correctly:

require 'rexml/document'
s = "<name>Lätt B bed. Två omgångar A:0 och A:0</name>"
puts REXML::Text::unnormalize(s)

m.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top