[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HTML and URL escaping functions
From: |
Deniz Dogan |
Subject: |
Re: HTML and URL escaping functions |
Date: |
Sun, 13 Jun 2010 21:31:17 +0200 |
2010/6/13 Aaron Maxwell <address@hidden>:
> Hi all,
>
> I wrote a few functions for escaping text with HTML entities, and back; and
> for quoting strings for inclusion in HTTP URLs, and back. The code is here:
>
> http://gist.github.com/436913
>
> Examples (there are equivalents that work on regions too):
> ; (html-escape-str "<whoah> nelly")
> ; "<whoah> nelly"
> ; (html-unescape-str "<whoah> nelly")
> ; "<whoah> nelly"
> ; (url-quote-str "ab/c de/f")
> ; "ab/c%20de/f"
> ; (url-unquote-str "ab/c%20de/f")
> ; "ab/c de/f"
>
> It needs some work, but is probably far enough along to be useful.
>
> Do you know if this exists already, in some free software library? I haven't
> been able to find equivalents anywhere. I partly wrote this to practice
> elisp, so it's okay if this is reinventing a wheel. If not, I'd like to
> clean it up so others can use it.
>
> Thanks,
> Aaron
>
> --
> Aaron Maxwell
> http://redsymbol.net/
>
>
About the HTML entities: I'm not sure how you implemented it, but e.g.
sgml-mode.el has `sgml-char-names' (along with sgml-name-8bit-mode)
and I'm pretty sure nxhtml has something for it as well. I don't know
about the "URL quoting".
--
Deniz Dogan