Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-05-06 21:48:22
- Nikolaj7
- New Member
- Registered: 2006-04-19
- Posts: 8
HTML Forms in Textpattern Article and International Characters
Hi,
I have a TXP installation where I want to integrate my Autoresponder system called Autoresponse Plus. There is a html form that I must put on a newsletter subscription page.
When I do that and somebody subscribes and has danish characters in his name the danish characters will appear with odd characters like æøå ÆØÅ instead of the right characters æ ø å Æ Ø Å in the database.
If I just put up a plain html page with the output html code from TXP the name appears correct with the danish characters.
This is the html form:
<form method=‘POST’ action=‘http://www.<mydomain>.dk/cgi-bin/arp3/arp3-formcapture.pl’>
<div align=‘center’><center>
<p>Navn<br><input type=‘text’ name=‘full_name’ size=‘20’></p>
</center></div>
<div align=‘center’><center>
<p>Adresse<br><input type=‘text’ name=‘street’ size=‘20’></p>
</center></div>
<div align=‘center’><center>
<p>Postnummer<br><input type=‘text’ name=‘zip’ size=‘20’></p>
</center></div>
<div align=‘center’><center>
<p>By<br><input type=‘text’ name=‘city’ size=‘20’></p>
</center></div>
<div align=‘center’><center>
<p>Land<br><input type=‘text’ name=‘country’ size=‘20’></p>
</center></div>
<div align=‘center’><center>
<p>Telefon<br><input type=‘text’ name=‘phone1’ size=‘20’></p>
</center></div>
<div align=‘center’><center>
<p>E-mail adresse<br><input type=‘text’ name=‘email’ size=‘20’></p>
</center></div>
<input type=‘hidden’ name=‘subscription_type’ value=’‘><div align=‘center’><center>
<p><input type=‘submit’ value=‘Ja tak, jeg vil gerne indmeldes’></p>
</center></div>
<input type=‘hidden’ name=‘id’ value=‘3’>
<input type=‘hidden’ name=‘extra_ar’ value=’‘>
<input type=‘hidden’ name=‘full_name_man’ value=‘1’>
<input type=‘hidden’ name=‘street_man’ value=‘1’>
<input type=‘hidden’ name=‘city_man’ value=‘1’>
<input type=‘hidden’ name=‘zip_man’ value=‘1’>
<input type=‘hidden’ name=‘country_man’ value=‘1’>
<input type=‘hidden’ name=‘phone1_man’ value=‘1’>
<input type=‘hidden’ name=‘notify_email’ value=‘info@<mydomain>.dk’>
<input type=‘hidden’ name=‘notify_subject’ value=‘Ny indmeldelse’>
<input type=‘hidden’ name=‘notify_include_form’ value=‘1’>
</form>
I tried to change the DOCTYPE and language without luck.
Please help me in this. I have been trying to solve this for days.
Thanks
Rgds,
Nikolaj
Offline
#2 2007-05-06 22:55:54
- zem
- Developer Emeritus

- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: HTML Forms in Textpattern Article and International Characters
Make sure you’re using UTF-8.
Alex
Offline
#3 2007-05-07 06:27:26
- Nikolaj7
- New Member
- Registered: 2006-04-19
- Posts: 8
Re: HTML Forms in Textpattern Article and International Characters
Hi Alex,
Thank you for your reply.
It still doesn’t work.
This is my DOCTYPE and charset and header section:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“da” lang=“da”>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />
<title><txp:page_title /></title>
<txp:feed_link flavor=“atom” format=“link” label=“Atom” /> <txp:feed_link flavor=“rss” format=“link” label=“RSS” />
<txp:css format=“link” />
</head>
mbstring.encoding_translation is turned off.
When I write normal articles the danish characters work allright, but when use the above form the danish characters are all wrong.
Thanks for your help.
Rgds,
Nikolaj
Offline
Re: HTML Forms in Textpattern Article and International Characters
Looks like the “arp3-formcapture.pl” script cannot handle UTF-8 characters.
If that’s a contact form script, you may want to consider using the zem_contact_reborn plugin instead.
Offline
#5 2007-05-07 12:14:21
- Nikolaj7
- New Member
- Registered: 2006-04-19
- Posts: 8
Re: HTML Forms in Textpattern Article and International Characters
Hi Ruud,
Thanks for the reply.
I think that the arp3-formcapture.pl script does support utf-8.
Because when I create a static html page with the output that TXP generates, the form works. It is only when the form is entered within TXP and run from that page that it does not work.
This script is a autoresponder system, so it cannot be changed to ZCR.
Any ideas of what can be wrong?
Thanks.
regards,
Nikolaj
Offline
Re: HTML Forms in Textpattern Article and International Characters
Try setting the ACCEPT-CHARSET attribute in the FORM tag to whatever charset the formcapture.pl script supports (probably some ISO charset).
Offline
#7 2007-05-07 15:33:52
- Nikolaj7
- New Member
- Registered: 2006-04-19
- Posts: 8
Re: HTML Forms in Textpattern Article and International Characters
Hi Ruud,
You solved this for me.
The accept-charset did it.
Thanks a lot for your help.
This is the form as it looks now:
<form method=‘POST’ action=‘http://www.<mydomain>.dk/cgi-bin/arp3/arp3-formcapture.pl’ accept-charset=‘iso-8859-1’>
<div align=‘center’><center>
<p>Navn<br><input type=‘text’ name=‘full_name’ size=‘20’></p>
</center></div>
<div align=‘center’><center>
<p>Adresse<br><input type=‘text’ name=‘street’ size=‘20’></p>
</center></div>
<div align=‘center’><center>
<p>Postnummer<br><input type=‘text’ name=‘zip’ size=‘20’></p>
</center></div>
<div align=‘center’><center>
<p>By<br><input type=‘text’ name=‘city’ size=‘20’></p>
</center></div>
<div align=‘center’><center>
<p>Land<br><input type=‘text’ name=‘country’ size=‘20’></p>
</center></div>
<div align=‘center’><center>
<p>Telefon<br><input type=‘text’ name=‘phone1’ size=‘20’></p>
</center></div>
<div align=‘center’><center>
<p>E-mail adresse<br><input type=‘text’ name=‘email’ size=‘20’></p>
</center></div>
<input type=‘hidden’ name=‘subscription_type’ value=’‘><div align=‘center’><center>
<p><input type=‘submit’ value=‘Ja tak, jeg vil gerne indmeldes’></p>
</center></div>
<input type=‘hidden’ name=‘id’ value=‘3’>
<input type=‘hidden’ name=‘extra_ar’ value=’‘>
<input type=‘hidden’ name=‘full_name_man’ value=‘1’>
<input type=‘hidden’ name=‘street_man’ value=‘1’>
<input type=‘hidden’ name=‘city_man’ value=‘1’>
<input type=‘hidden’ name=‘zip_man’ value=‘1’>
<input type=‘hidden’ name=‘country_man’ value=‘1’>
<input type=‘hidden’ name=‘phone1_man’ value=‘1’>
<input type=‘hidden’ name=‘notify_email’ value=‘info@<mydomain>.dk’>
<input type=‘hidden’ name=‘notify_subject’ value=‘Ny indmeldelse’>
<input type=‘hidden’ name=‘notify_include_form’ value=‘1’>
</form>
Best regards,
Nikolaj
Offline
#8 2007-05-07 19:52:49
- Nikolaj7
- New Member
- Registered: 2006-04-19
- Posts: 8
Re: HTML Forms in Textpattern Article and International Characters
Unfortunately it only worked with the Firefox browser. With IE 6 it doesn’t work. I suppose that IE cannot change the charset on the form.
Any ideas?
Thanks.
Rgds,
Nikolaj
Last edited by Nikolaj7 (2007-05-07 19:53:16)
Offline
Re: HTML Forms in Textpattern Article and International Characters
If you can change the formcapture.pl script and if these weird characters only appear in email, you can add a header to the email (in formcapture.pl) that indicates the charset (UTF-8).
Offline
#10 2007-05-08 06:12:13
- Nikolaj7
- New Member
- Registered: 2006-04-19
- Posts: 8
Re: HTML Forms in Textpattern Article and International Characters
This is a listsystem, where the formcapture script connect to a database and populates it with the data from the form. And then the email is sent also with the errors in.
It is a commercial script that is compiled, so I do not have access to the code.
Is there a way to have “cheat” IE to have this to work? As mentioned it works on Firefox.
Thanks.
Best regards,
Nikolaj
Offline
Re: HTML Forms in Textpattern Article and International Characters
I know Perl can look like line noise, but are you 100% sure it’s compiled?
Apart from the things suggested above, I’m out of ideas.
Offline
#12 2007-05-08 11:00:44
- Nikolaj7
- New Member
- Registered: 2006-04-19
- Posts: 8
Re: HTML Forms in Textpattern Article and International Characters
Hi Ruud,
Thanks a lot for you help.
I have also contacted the company where I bought this autoresponder.
But your solution works on Firefox, so clearly it must be an IE issue. And there must be an IE hack that will solve this.
If I get a workable reply from the developer I will post it here.
If there are others in this forum that can add anything to this problem all comments are greatly appreciated.
Again thanks for your help Ruud. You brought me closer to a solution and I really appreciate it.
Rgds,
Nikolaj
Offline