Home : Products : DBMan : Customization :

Products: DBMan: Customization: Re: [LoisC] funny characters in email: Edit Log

Here is the list of edits for this post
Re: [LoisC] funny characters in email
I think Lois is right.. I'm sure there's a way to tell the form what encoding to use so that the data comes from the form all "cleaned up" and properly formatted.

In the meantime I found a work-around, but it's not pretty.

Open Word and type a quote " (in Word it will be curly)

Save page as txt but don't close the file. Instead, highlight the quote and then paste it into textpad (or at least that's what I use).

You hopefully will get something like a "fat pipe" character or square box then you can do something like:

$var =~ s/[]/"/g;

Code:
#!/usr/local/bin/perl
use CGI::Carp qw/fatalsToBrowser/;

$var = 'β€œmeβ€œ';

$var =~ s/β€œ/"/g;



print "Content-Type: text/html;\n\n";
print qq|<HTML><HEAD><TITLE></TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF">
$var;
</BODY>
</HTML>
|;

It probably doesn't show correctly but it works for me - where you see backward quotes in the text file is actually a black square. I uploaded it to the webserver and it actually worked!

Of course I'm sure this totatlly politically incorrect. Instead you definitely want to look into "form encoding" I think that will solve your problem.

.

Last edited by:

Watts: Feb 16, 2009, 1:56 PM

Edit Log: