email link and foreign accent

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vittorio

    email link and foreign accent

    Hi,

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

    print"""<a href="mailto:%s ">""" %(campovalore.e ncode('iso-8859-1'))
    print campovalore.enc ode('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
  • Peter Hansen

    #2
    Re: email link and foreign accent

    Vittorio wrote:[color=blue]
    > print"""<a href="mailto:%s ">""" %(campovalore.e ncode('iso-8859-1'))
    > print campovalore.enc ode('iso-8859-1')
    > print """</a>"""
    >
    > campovalore is an email address with special (italian) characters.
    > [snip]
    > Any suggestion is welcome,[/color]

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

    -Peter

    Comment

    • Vittorio

      #3
      Re: email link and foreign accent

      Peter Hansen <peter@engcorp. com> wrote in news:6f-dnTSTQazBSlvfRV n-
      jQ@powergate.ca:
      [color=blue]
      > Vittorio wrote:[color=green]
      >> print"""<a href="mailto:%s ">""" %(campovalore.e ncode('iso-8859-1'))
      >> print campovalore.enc ode('iso-8859-1')
      >> print """</a>"""
      >>[/color]
      > It might help if you showed us the output of "repr(x)" where x is the
      > output of the campovalore.enc ode('iso-8859-1') part above.[/color]

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

      'carr\xe0@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

      Comment

      • Vittorio

        #4
        Re: email link and foreign accent

        Vittorio <renmybiru@libe ro.it> wrote in news:Xns96896D4 6D9DCCSoToSpeak @
        195.110.128.18:
        [color=blue]
        > Thanks Peter for replying.
        > This is an example of the output of repr(x) as you requested:
        >
        > 'carr\xe0@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[/color]

        adjournment:

        link opened from Firefox->Thunderbird: it works
        link opened from IE6->Thunderbird: it works

        Comment

        Working...