DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

UTF8 Curly Quotes To ASCII

04.09.2005
| 13972 views |
  • submit to reddit
        Here's a cheap hack to convert UTF8 curly quotes to ASCII (but try to use CPAN module instead of this if you can).

 $xml =~ s/\xe2\x80\x99/\'/gs;
 $xml =~ s/\xe2\x80\x98/\'/gs;
 $xml =~ s/\xe2\x80\x9c/\"/gs;
 $xml =~ s/\xe2\x80\x9d/\"/gs;