Thomas89 / simplemodal

Automatically exported from code.google.com/p/simplemodal
0 stars 0 forks source link

subject is messed up #47

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
SimpleModal or SimpleModal Contact Form (SMCF)?
SMCF

Version of SimpleModal of SMCF (indicate Demo or WordPress plugin)?
1.4.1

Version of jQuery?
1.4.3

Browser/OS you are experiencing the problem with?
firefox latest, opera latest, IE 8

If applicable, please list the other code/libraries/plugins you are trying
to integrate with.
only plain jquery library and smcf

Description: when I sent a test e-mail, and use special (national) chars in 
subject, the mail comes with messed up subject.
Example: using "ółńźćż" letters, makes the subject appear as 
"tężźć óąówaę". Every php contact script I've ever 
tried had problems with subject encoding. In smcf source code everything seems 
to be ok. All files are saved as utf8 w/o bom.

Original issue reported on code.google.com by jo...@tlen.pl on 11 Nov 2010 at 5:10

GoogleCodeExporter commented 8 years ago
Commenting conditional with mb_encode_mimeheader solved the problem

    // UTF-8
    /*if (function_exists('mb_encode_mimeheader')) {
        $subject = mb_encode_mimeheader($subject, "UTF-8", "B", "\n");
    }
    else {
        // you need to enable mb_encode_mimeheader or risk 
        // getting emails that are not UTF-8 encoded
    }
    */

Original comment by jo...@tlen.pl on 11 Nov 2010 at 3:55

GoogleCodeExporter commented 8 years ago
Thanks for letting me know. Perhaps I should just remove that section of 
code...?

Original comment by emartin24 on 3 Dec 2010 at 12:34

GoogleCodeExporter commented 8 years ago
To be honest I haven't tested it on different hosts. I suppose that only on 
certain LAMP configurations mb_encode_mimeheader may not be working as supposed.
Maybe it's caused by overall mail encoding, and switching between 7bit / 8bit / 
binary / base64 / quoted- printable would fix it.

I'd leave it as it is, because it was possible to "fix" it without major 
changes in code. But I'd definitely give a hint in FAQ, that when somebody has 
a problem with subject encoding, he should place a comment on this function.

ps. don't want to start another issue, but  since you've read that, I've got 2 
questions:
1. will you consider moving all labels, and message texts into an external 
file, to allow easy translation of your script ? 
Currently man has to edit 3 (or were there only 2?)  different files, and 
finding the proper line to change form texts takes some time.

2. It's my personal best jquery contact script, and I love it for it's 
simplicity and ... because it just works as supposed :)
But I think there's 1 small flaw. When it goes to internet exploder (still 
majority of internauts use it), version 8 blocks some things by default.
Having this on mind, would you consider a way to launch the contact script as a 
standalone page? This could allow users to embed contact form directly on a 
page (a simple transition to roll the script could be used, but with js turned 
off it would be shown anyway).

Original comment by jo...@tlen.pl on 3 Dec 2010 at 11:33

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I'm a bit more wise than when I was writing above post.
mb_substr() funct. should be used with multibytes character encoding, such as 
russian, chineese  or any sign based language (along with eastern languages).
For western and central european languages (at least for polish), substr() 
funct. works perfectly.

Original comment by jo...@tlen.pl on 5 Dec 2010 at 8:20