MySQL Forums
Forum List  »  Perl

Re: Issue with special characters in Perl
Posted by: Randy Clamons
Date: April 10, 2009 11:26AM

It's the browser weirdly displaying the special characters. You'll need to translate these characters to HTMLencoding or change them to an equivalent character in whatever encoding (UTF-8) your site is. I usually do the translation before saving the data to a table.

This particular one happens most often when you use open and close quotes rather than the simple double-quote ("). I mostly see it when Mac users paste the text into a textarea. I can't show you the code I use to translate these characters because your browser won't show you the actual characters being replaced (they'll have a weird display).

Use a regular expression substitution. Find the character in your table, copy to the clipboard. Start your regular expression ( $str =~ s/ ) then paste that character into your code and finish the expression ( /\"/g). Do this far all the special characters the have a weird display. Put them all into one function you call before saving data to your table.

Good luck!

Options: ReplyQuote


Subject
Written By
Posted
Re: Issue with special characters in Perl
April 10, 2009 11:26AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.