By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,931 Members | 1,976 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,931 IT Pros & Developers. It's quick & easy.

email link and foreign accent

P: n/a
Hi,

I have one problem ( I am a python beginner) in a cgi:

print"""<a href="mailto:%s">""" %(campovalore.encode('iso-8859-1'))
print campovalore.encode('iso-8859-1')
print """</a>"""
campovalore is an email address with special (italian) characters.

From IE6 everything is fine and the link launches my predefined (in
Windows) email client with the correct string in the mailto field.

But from Firefox and the same email client I have an incorrect mailto field
every time there is a special character in the string.

Any suggestion is welcome,

vittorio
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Vittorio wrote:
print"""<a href="mailto:%s">""" %(campovalore.encode('iso-8859-1'))
print campovalore.encode('iso-8859-1')
print """</a>"""

campovalore is an email address with special (italian) characters.
[snip]
Any suggestion is welcome,


It might help if you showed us the output of "repr(x)" where x is the
output of the campovalore.encode('iso-8859-1') part above.

-Peter
Jul 19 '05 #2

P: n/a
Peter Hansen <pe***@engcorp.com> wrote in news:6f-dnTSTQazBSlvfRVn-
jQ@powergate.ca:
Vittorio wrote:
print"""<a href="mailto:%s">""" %(campovalore.encode('iso-8859-1'))
print campovalore.encode('iso-8859-1')
print """</a>"""

It might help if you showed us the output of "repr(x)" where x is the
output of the campovalore.encode('iso-8859-1') part above.


Thanks Peter for replying.
This is an example of the output of repr(x) as you requested:

'carr\xe*@pluto.it'

Results:
link opened from IE6->Outlook: it works
link opened from IE6->Pocomail: it works
link opened from Firefox->Outlook: characters with accent fail
link opened from Firefox->Pocomail: characters with accent fail

It looks like having to do more with Firefox than with Python itself but
maybe someone can help anyway?

vittorio
Jul 21 '05 #3

P: n/a
Vittorio <re*******@libero.it> wrote in news:Xns96896D46D9DCCSoToSpeak@
195.110.128.18:
Thanks Peter for replying.
This is an example of the output of repr(x) as you requested:

'carr\xe*@pluto.it'

Results:
link opened from IE6->Outlook: it works
link opened from IE6->Pocomail: it works
link opened from Firefox->Outlook: characters with accent fail
link opened from Firefox->Pocomail: characters with accent fail


adjournment:

link opened from Firefox->Thunderbird:it works
link opened from IE6->Thunderbird:it works
Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.