HTML entites in ClothRed: yay or nay?

P

Phillip Gawlowski

In preparation of release 0.3.0 (hopefully later today ;), I'm
wondering: Should I translated HTML entities into human-readable format?
My hunch is yes, as that's the point of Textile.

So, I'm at a bit of a loss: I've never, ever worked with character
encodings (I don't even know how to check the encoding on Linux or Windows).

So, my question is, how do I replace the HTML entities with ISO-8859-1
characters?

The trouble is, that the character encodings don't seem to be taken off
of UTF-8 or something else that I can just escape, or can I?

Meanwhile, I'm digging through the RDoc documentation. Hopefully, I can
find something there.

--
Phillip "CynicalRyan" Gawlowski
http://cynicalryan.110mb.com/
http://clothred.rubyforge.org

Rule of Open-Source Programming #13:

Your first release can always be improved upon.
 
A

Adriano Ferreira

It seems like you need HTMLEntities
(http://htmlentities.rubyforge.org/) which will add a dependency on
your distribution (but better than repeating the same effort others
did).

I think that dependency may be made optional and ClothRed could throw
an exception when asked to decode HTML entities and could not find
that module. I don't know if this is acceptable to you.

From the docs, code like

require 'htmlentities'
coder =3D HTMLEntities.new
string =3D "élan"
coder.decode(string) # =3D> "=E9lan"

take your HTML with entities into UTF-8 characters if I understood correctl=
y.

Cheers,
Adriano Ferreira.
 

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

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top