Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Bug in subject line when using french accents

Quote Reply
Bug in subject line when using french accents
Hi,

I get few bugs in the subject line in my outgoing emails from .eml templates. The french accents seem to cause few bugs with Netscape Messaging Server 4.15 (spaces disappear, extra spaces appear...). The outgoing emails are set to iso-8859-1, so I don't really know where the bugs appear. But I don't have these bugs with some others scripts on the same server, like SquirrelMail. This script transforms the subject line in one big word: it remplaces all the spaces by "_" and this works perfectly with the french accents.

Does anybody know how I can remove all the spaces in the subject line, how I can transform the subject line in one big word, even when there is variables in it (<%cat_full_name%>, <%forum_name%>...)?

Thank you for your help!

François

Last edited by:

Franco: Feb 7, 2002, 7:54 AM
Quote Reply
Re: [Franco] Bug in subject line when using french accents In reply to
The easiest way is probably to create a global function, call it "remove spaces".

In the template, you just pass everything into it, like this:

Code:
<%remove_spaces("This is some text", $variable, "more text", $another_variable, "etc.")%>


The global sub should contain something along these lines:

Code:


sub { my $s = "@_"; $s =~ tr/ \t\r\n/____/; return \$s }
Let me know how you make out

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Bug in subject line when using french accents In reply to
Hi Jason,

Thank you very much for your answer.

I realized that changing spaces with "_" in the subject line do not work completely. I found that the problem appears only when there is a long subject; strange paragraph breaks appear in the line when the subject is too long. Since for each accent the iso-8859-1 code appears for each one (example, for the letter "à" it gives "?iso-8859-1?Q?=E0?="), it just takes few accents in the subject line to have a really long subject line.

If you can find a way to do this (below), it will probably solve the problem. The SquirrelMail script do it and it works perfectly.

1- Remove all the spaces in the subject line and remplace them with "_". Exemple: "Nouveaux messages dans le forum «Principes, pensées, réflexions de voyageurs»" wil give "Nouveaux_messages_dans_le_forum_«Principes,_pensées,_réflexions_de_voyageurs»

2- Transform the accents in the subject line in iso-8859-1 code. Example: "Nouveaux_messages_dans_le_forum_=ABPrincipes,_pens=E9es,_r=E9flexions_de_voyageurs=BB"
3- Put at the beginning of the line "=?iso-8859-1?Q?", and at the end "?=". Example: "=?iso-8859-1?Q?Nouveaux_messages_dans_le_forum_=ABPrincipes,_pens=E9es,_r=E9flexions_de_voyageurs=BB?="

I found a temporary solution which works correctly, but a little longer to setup. I simply add a new colum in the forum table in which I put the subscribe.eml subject line for each forum in iso-8859-1 code (exemple: "=?iso-8859-1?Q?Nouveaux_messages_dans_le_forum_=ABPrincipes,_pens=E9es,_r=E9flexions_de_voyageurs=BB?=").

Thank you very much! Smile

Sorry for my poor english...

François

Last edited by:

Franco: Feb 26, 2002, 5:14 PM