in reply to Regexp to convert high-bit (?) characters to character entites
I need a regexp that will convert high-bit characters (eg. > \0377 ?) to the appropriate character entity (eg. &x123;).
No, you do not need a regexp that will do that. There's a very nice module that does HTML entities: HTML::Entities.
When I'm in a hurry, I often use s/(\W)/'&#' . ord($1) . ';'/g for dumping data, because it's so easy to convert it back to the original, and encoding printable \W characters doesn't hurt.
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
|
|---|