UTF-8 Email with links

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kamlai@gmail.com

    UTF-8 Email with links

    Hi all,

    I have an email in utf-8 encoding. In the content of the email, I need
    to send a link in which the filename is in utf-8 string...just like
    this..

    $content = "<a href=\"http://xxxxxx/".$filename."\" ">Link to file</a>";

    however, the link can not be correctly passsed and it automatically
    encodes it into %xx format. How to solve the problem?

    I've tried urlencode($file name) and urldecode($file name) but cannot fix
    the problem... Need Help~Thx

  • John Dunlop

    #2
    Re: UTF-8 Email with links

    kamlai wrote:
    [color=blue]
    > I have an email in utf-8 encoding. In the content of the email, I need
    > to send a link in which the filename is in utf-8 string...just like
    > this..
    >
    > $content = "<a href=\"http://xxxxxx/".$filename."\" ">Link to file</a>";
    >
    > however, the link can not be correctly passsed and it automatically
    > encodes it into %xx format. How to solve the problem?[/color]

    Maybe they do get across as-is, just like the same characters outwith
    URLs would, but your MUA percent-encodes raw non-US-ASCIIs in anything it
    considers a URL?
    [color=blue]
    > I've tried urlencode($file name) and urldecode($file name) but cannot fix
    > the problem...[/color]

    Have you thought of percent-encoding them yourself *before* sending the
    e-mail? or, sorry, is that what you're saying you've tried?

    --
    Jock

    Comment

    • Tim Roberts

      #3
      Re: UTF-8 Email with links

      kamlai@gmail.co m wrote:[color=blue]
      >
      >I have an email in utf-8 encoding. In the content of the email, I need
      >to send a link in which the filename is in utf-8 string...just like
      >this..
      >
      >$content = "<a href=\"http://xxxxxx/".$filename."\" ">Link to file</a>";
      >
      >however, the link can not be correctly passsed and it automatically
      >encodes it into %xx format. How to solve the problem?[/color]

      You allow it to encode into the %xx format. URLs are not supposed to
      contain any characters outside of 20 - 7F.
      [color=blue]
      >I've tried urlencode($file name) and urldecode($file name) but cannot fix
      >the problem...[/color]

      What operating system are you using? Are you sure the operating system
      allows utf-8 filenames?
      --
      - Tim Roberts, timr@probo.com
      Providenza & Boekelheide, Inc.

      Comment

      Working...