On Thu, 26 Nov 2009 00:47:00 +0000
Hugo Monteiro <hugo.monte...@fct.unl.pt> wrote:

> Steve et al,
> 
Hallo Hugo,


> I noticed that the templates are using html special chars for 
> diacritics. Do you think that we could make the build process go through 
> the templates and automagically translate those characters into their 
> correspondent html special chars? .. That might speed up the translation 
> process and increase submissions. Not only that, it would make template 
> maintenance a bit easier.
> 
> Any thoughts?
> 
ach Hugo. If time would not be such a big issue then I could code whatever is 
needed to make things go faster, more easy, etc... but there is so much things 
to do and so less time to make all this happen. If any one want's to do that 
character transformation during build time then I have nothing to say against 
it. But going now to sit down and code that is something I will not do. When we 
forked DSPAM (or better to say: when we took over) a lot of the users where 
claiming to redo the WebUI in something else then Perl. So far nothing has 
emerged in that direction. We still are using Perl and we hack that thing to 
death with patches, knowing that we want to get rid of it.

If you need a quick and dirty way of replacing those special characters then 
you could use GNU sed to do the job:
----------------------
sed 
"s:\d160:\&nbsp;:g;s:\d161:\&iexcl;:g;s:\d162:\&cent;:g;s:\d163:\&pound;:g;s:\d164:\&curren;:g;s:\d165:\&yen;:g;s:\d166:\&brvbar;:g;s:\d167:\&sect;:g;s:\d168:\&uml;:g;s:\d169:\&copy;:g;s:\d170:\&ordf;:g;s:\d171:\&laquo;:g;s:\d172:\&not;:g;s:\d173:\&shy;:g;s:\d174:\&reg;:g;s:\d175:\&macr;:g;s:\d176:\&deg;:g;s:\d177:\&plusmn;:g;s:\d178:\&sup2;:g;s:\d179:\&sup3;:g;s:\d180:\&acute;:g;s:\d181:\&micro;:g;s:\d182:\&para;:g;s:\d183:\&middot;:g;s:\d184:\&cedil;:g;s:\d185:\&sup1;:g;s:\d186:\&ordm;:g;s:\d187:\&raquo;:g;s:\d188:\&frac14;:g;s:\d189:\&frac12;:g;s:\d190:\&frac34;:g;s:\d191:\&iquest;:g;s:\d192:\&Agrave;:g;s:\d193:\&Aacute;:g;s:\d194:\&Acirc;:g;s:\d195:\&Atilde;:g;s:\d196:\&Auml;:g;s:\d197:\&Aring;:g;s:\d198:\&AElig;:g;s:\d199:\&Ccedil;:g;s:\d200:\&Egrave;:g;s:\d201:\&Eacute;:g;s:\d202:\&Ecirc;:g;s:\d203:\&Euml;:g;s:\d204:\&Igrave;:g;s:\d205:\&Iacute;:g;s:\d206:\&Icirc;:g;s:\d207:\&Iuml;:g;s:\d208:\&ETH;:g;s:\d209:\&Ntilde;:g;s:\d210:\&Ograve;:g;s:\d211:\&Oacute;:g;s:\d212:\&Ocirc;:g;s:\d213:\&Otilde;:g;s:\d214:\&Ouml;:g;s:\d215:\&times;:g;s:\d216:\&Oslash;:g;s:\d217:\&Ugrave;:g;s:\d218:\&Uacute;:g;s:\d219:\&Ucirc;:g;s:\d220:\&Uuml;:g;s:\d221:\&Yacute;:g;s:\d222:\&THORN;:g;s:\d223:\&szlig;:g;s:\d224:\&agrave;:g;s:\d225:\&aacute;:g;s:\d226:\&acirc;:g;s:\d227:\&atilde;:g;s:\d228:\&auml;:g;s:\d229:\&aring;:g;s:\d230:\&aelig;:g;s:\d231:\&ccedil;:g;s:\d232:\&egrave;:g;s:\d233:\&eacute;:g;s:\d234:\&ecirc;:g;s:\d235:\&euml;:g;s:\d236:\&igrave;:g;s:\d237:\&iacute;:g;s:\d238:\&icirc;:g;s:\d239:\&iuml;:g;s:\d240:\&eth;:g;s:\d241:\&ntilde;:g;s:\d242:\&ograve;:g;s:\d243:\&oacute;:g;s:\d244:\&ocirc;:g;s:\d245:\&otilde;:g;s:\d246:\&ouml;:g;s:\d247:\&divide;:g;s:\d248:\&oslash;:g;s:\d249:\&ugrave;:g;s:\d250:\&uacute;:g;s:\d251:\&ucirc;:g;s:\d252:\&uuml;:g;s:\d253:\&yacute;:g;s:\d254:\&thorn;:g;s:\d255:\&yuml;:g;"
----------------------

I have made that one liner by quickly crafting a regexp out of the code I used 
in decode.c. I have not taken any character afte ASCII 255 and I have avoided 
to use characters that could potentialy be found in normal HTML tags (stuff 
like <, >, &, etc).

The sed one liner does not take care where the caracter is found. So it could 
potentialy destroy valid HTML. I just have no time to make a rock solid 
translation module. That would be to time intensive.

If you want to quickly check what characters are replaced then do fire up your 
shell and execute this here:
----------------------
awk 'BEGIN {for(i=32;i<256;i++) printf "%3d %c\n",i,i}'|sed 
"s:\d160:\0\t\&nbsp;:g;s:\d161:\0\t\&iexcl;:g;s:\d162:\0\t\&cent;:g;s:\d163:\0\t\&pound;:g;s:\d164:\0\t\&curren;:g;s:\d165:\0\t\&yen;:g;s:\d166:\0\t\&brvbar;:g;s:\d167:\0\t\&sect;:g;s:\d168:\0\t\&uml;:g;s:\d169:\0\t\&copy;:g;s:\d170:\0\t\&ordf;:g;s:\d171:\0\t\&laquo;:g;s:\d172:\0\t\&not;:g;s:\d173:\0\t\&shy;:g;s:\d174:\0\t\&reg;:g;s:\d175:\0\t\&macr;:g;s:\d176:\0\t\&deg;:g;s:\d177:\0\t\&plusmn;:g;s:\d178:\0\t\&sup2;:g;s:\d179:\0\t\&sup3;:g;s:\d180:\0\t\&acute;:g;s:\d181:\0\t\&micro;:g;s:\d182:\0\t\&para;:g;s:\d183:\0\t\&middot;:g;s:\d184:\0\t\&cedil;:g;s:\d185:\0\t\&sup1;:g;s:\d186:\0\t\&ordm;:g;s:\d187:\0\t\&raquo;:g;s:\d188:\0\t\&frac14;:g;s:\d189:\0\t\&frac12;:g;s:\d190:\0\t\&frac34;:g;s:\d191:\0\t\&iquest;:g;s:\d192:\0\t\&Agrave;:g;s:\d193:\0\t\&Aacute;:g;s:\d194:\0\t\&Acirc;:g;s:\d195:\0\t\&Atilde;:g;s:\d196:\0\t\&Auml;:g;s:\d197:\0\t\&Aring;:g;s:\d198:\0\t\&AElig;:g;s:\d199:\0\t\&Ccedil;:g;s:\d200:\0\t\&Egrave;:g;s:\d201:\0\t\&Eacute;:g;s:\d202:\0\t\&Ecirc;:g;s:\d203:\0\t\&Euml;:g;s:\d204:\0\t\&Igrave;:g;s:\d205:\0\t\&Iacute;:g;s:\d206:\0\t\&Icirc;:g;s:\d207:\0\t\&Iuml;:g;s:\d208:\0\t\&ETH;:g;s:\d209:\0\t\&Ntilde;:g;s:\d210:\0\t\&Ograve;:g;s:\d211:\0\t\&Oacute;:g;s:\d212:\0\t\&Ocirc;:g;s:\d213:\0\t\&Otilde;:g;s:\d214:\0\t\&Ouml;:g;s:\d215:\0\t\&times;:g;s:\d216:\0\t\&Oslash;:g;s:\d217:\0\t\&Ugrave;:g;s:\d218:\0\t\&Uacute;:g;s:\d219:\0\t\&Ucirc;:g;s:\d220:\0\t\&Uuml;:g;s:\d221:\0\t\&Yacute;:g;s:\d222:\0\t\&THORN;:g;s:\d223:\0\t\&szlig;:g;s:\d224:\0\t\&agrave;:g;s:\d225:\0\t\&aacute;:g;s:\d226:\0\t\&acirc;:g;s:\d227:\0\t\&atilde;:g;s:\d228:\0\t\&auml;:g;s:\d229:\0\t\&aring;:g;s:\d230:\0\t\&aelig;:g;s:\d231:\0\t\&ccedil;:g;s:\d232:\0\t\&egrave;:g;s:\d233:\0\t\&eacute;:g;s:\d234:\0\t\&ecirc;:g;s:\d235:\0\t\&euml;:g;s:\d236:\0\t\&igrave;:g;s:\d237:\0\t\&iacute;:g;s:\d238:\0\t\&icirc;:g;s:\d239:\0\t\&iuml;:g;s:\d240:\0\t\&eth;:g;s:\d241:\0\t\&ntilde;:g;s:\d242:\0\t\&ograve;:g;s:\d243:\0\t\&oacute;:g;s:\d244:\0\t\&ocirc;:g;s:\d245:\0\t\&otilde;:g;s:\d246:\0\t\&ouml;:g;s:\d247:\0\t\&divide;:g;s:\d248:\0\t\&oslash;:g;s:\d249:\0\t\&ugrave;:g;s:\d250:\0\t\&uacute;:g;s:\d251:\0\t\&ucirc;:g;s:\d252:\0\t\&uuml;:g;s:\d253:\0\t\&yacute;:g;s:\d254:\0\t\&thorn;:g;s:\d255:\0\t\&yuml;:g;"
----------------------

The replaced characters are in the third column. I think anything after ASCII 
160 is normaly not found in a place that can not be replaced with the HTML 
character encoding. But I don't know 100% if this is valid? I just assumed that 
it's that way.

Just to make you happy I checked the currently available templates to see if 
there is potentialy any HTML or strings.pl file that should be changed. With 
the following result:
----------------------
theia dspam # find ./webui/cgi-bin/templates/ -type f -name "*.html" -or -name 
"strings.pl"|while read foo;do sed 
"s:\d160:\&nbsp;:g;s:\d161:\&iexcl;:g;s:\d162:\&cent;:g;s:\d163:\&pound;:g;s:\d164:\&curren;:g;s:\d165:\&yen;:g;s:\d166:\&brvbar;:g;s:\d167:\&sect;:g;s:\d168:\&uml;:g;s:\d169:\&copy;:g;s:\d170:\&ordf;:g;s:\d171:\&laquo;:g;s:\d172:\&not;:g;s:\d173:\&shy;:g;s:\d174:\&reg;:g;s:\d175:\&macr;:g;s:\d176:\&deg;:g;s:\d177:\&plusmn;:g;s:\d178:\&sup2;:g;s:\d179:\&sup3;:g;s:\d180:\&acute;:g;s:\d181:\&micro;:g;s:\d182:\&para;:g;s:\d183:\&middot;:g;s:\d184:\&cedil;:g;s:\d185:\&sup1;:g;s:\d186:\&ordm;:g;s:\d187:\&raquo;:g;s:\d188:\&frac14;:g;s:\d189:\&frac12;:g;s:\d190:\&frac34;:g;s:\d191:\&iquest;:g;s:\d192:\&Agrave;:g;s:\d193:\&Aacute;:g;s:\d194:\&Acirc;:g;s:\d195:\&Atilde;:g;s:\d196:\&Auml;:g;s:\d197:\&Aring;:g;s:\d198:\&AElig;:g;s:\d199:\&Ccedil;:g;s:\d200:\&Egrave;:g;s:\d201:\&Eacute;:g;s:\d202:\&Ecirc;:g;s:\d203:\&Euml;:g;s:\d204:\&Igrave;:g;s:\d205:\&Iacute;:g;s:\d206:\&Icirc;:g;s:\d207:\&Iuml;:g;s:\d208:\&ETH;:g;s:\d209:\&Ntilde;:g;s:\d210:\&Ograve;:g;s:\d211:\&Oacute;:g;s:\d212:\&Ocirc;:g;s:\d213:\&Otilde;:g;s:\d214:\&Ouml;:g;s:\d215:\&times;:g;s:\d216:\&Oslash;:g;s:\d217:\&Ugrave;:g;s:\d218:\&Uacute;:g;s:\d219:\&Ucirc;:g;s:\d220:\&Uuml;:g;s:\d221:\&Yacute;:g;s:\d222:\&THORN;:g;s:\d223:\&szlig;:g;s:\d224:\&agrave;:g;s:\d225:\&aacute;:g;s:\d226:\&acirc;:g;s:\d227:\&atilde;:g;s:\d228:\&auml;:g;s:\d229:\&aring;:g;s:\d230:\&aelig;:g;s:\d231:\&ccedil;:g;s:\d232:\&egrave;:g;s:\d233:\&eacute;:g;s:\d234:\&ecirc;:g;s:\d235:\&euml;:g;s:\d236:\&igrave;:g;s:\d237:\&iacute;:g;s:\d238:\&icirc;:g;s:\d239:\&iuml;:g;s:\d240:\&eth;:g;s:\d241:\&ntilde;:g;s:\d242:\&ograve;:g;s:\d243:\&oacute;:g;s:\d244:\&ocirc;:g;s:\d245:\&otilde;:g;s:\d246:\&ouml;:g;s:\d247:\&divide;:g;s:\d248:\&oslash;:g;s:\d249:\&ugrave;:g;s:\d250:\&uacute;:g;s:\d251:\&ucirc;:g;s:\d252:\&uuml;:g;s:\d253:\&yacute;:g;s:\d254:\&thorn;:g;s:\d255:\&yuml;:g;"
 "${foo}">/tmp/_ds_$$;diff -Naur "${foo}" "/tmp/_ds_$$" >/dev/null 2>&1;if [ 
"${?}" != "0" ];then echo "File that probably needs to be fixed: 
${foo}";fi;done;rm "/tmp/_ds_$$"
File that probably needs to be fixed: 
./webui/cgi-bin/templates/de/nav_admin_preferences.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/de/nav_alerts.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/de/nav_preferences.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/he/nav_admin_error.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/he/nav_admin_preferences.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/he/nav_admin_status.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/he/nav_admin_user.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/he/nav_alerts.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/he/nav_analysis.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/he/nav_error.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/he/nav_fragment.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/he/nav_history.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/he/nav_performance.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/he/nav_preferences.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/he/nav_quarantine.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/he/nav_viewmessage.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/ro/nav_admin_error.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/ro/nav_admin_preferences.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/ro/nav_admin_status.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/ro/nav_admin_user.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/ro/nav_alerts.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/ro/nav_error.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/ro/nav_history.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/ro/nav_performance.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/ro/nav_preferences.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/ro/nav_quarantine.html
File that probably needs to be fixed: 
./webui/cgi-bin/templates/ro/nav_viewmessage.html
File that probably needs to be fixed: ./webui/cgi-bin/templates/pt-br/strings.pl
theia dspam #
----------------------

The Hebrew version is out of scope since it uses dual byte unicode and I did 
not take care of that. The de, ro and pt-br are probably the ones we should fix.


> Warm Regards, cause it's cold! =)
> 
The heart is what needs to be warm. Anything else can be heaten up :)


> Hugo Monteiro.
> 
Steve

> -- 
> ci.fct.unl.pt:~# cat .signature
> 
> Hugo Monteiro
> Email  : hugo.monte...@fct.unl.pt
> Telefone : +351 212948300 Ext.15307
> Web      : http://hmonteiro.net
> 
> Centro de Informática
> Faculdade de Ciências e Tecnologia da
>                  Universidade Nova de Lisboa
> Quinta da Torre   2829-516 Caparica   Portugal
> Telefone: +351 212948596   Fax: +351 212948548
> www.ci.fct.unl.pt           ap...@fct.unl.pt
> 
> ci.fct.unl.pt:~# _
> 
> 
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Dspam-devel mailing list
> Dspam-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dspam-devel
> 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Dspam-devel mailing list
Dspam-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspam-devel

Reply via email to