3 Replies Latest reply on Nov 21, 2006 2:54 PM by Production Monkey

    URL encoding problem with Mac OSX "mail" program

    Production Monkey Level 3
      I’m using BuddyAPI’s baOpenUrl() to send email through a user’s default mail client which generally works fine. Exceptions occur when the subject or body has any of the following symbols - ™ ® ©. If there is one or more of these symbols then the subject and body are blank on a Mac, but come across fine in outlook on Windows.

      I’m wondering if anyone has run into this. And, better yet. Did you find a way to make the mail program on the Mac behave properly?

      Here’s the code I’m using:

      In the message window type:

      Address = ""
      Subject = "Company Trademark™"
      Body = "Check out our new Product®"
      sendEmail(Address, Subject, Body)

      Movie Script handlers:

      on sendEmail Address, Subject, body
      Subject = URLEncode(Subject)
      Subject = fixUrlEncode(Subject)
      body = URLEncode(body)
      body = fixUrlEncode(body)
      baOpenUrl("mailto:" & Address & "?subject=" & subject & "&body=" & body, "normal")
      end sendEmail

      on fixUrlEncode aString -- changes "+" to the correct urlencoding for a space.
      _player.itemDelimiter = "+"
      NewString = aString.item[1]
      repeat with ItemNum = 2 to aString.item.count
      NewString = NewString & "%20" & aString.item[ItemNum]
      end repeat
      return NewString
      end fixUrlEncode