• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Rép: Unicode versus Utf8
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rép: Unicode versus Utf8


  • Subject: Re: Rép: Unicode versus Utf8
  • From: Philip Aker <email@hidden>
  • Date: Sun, 5 Jul 2009 12:37:05 -0700

On 2009-07-05, at 12:30:55, Philip Aker wrote:

On 2009-07-05, at 12:04:32, Yvan KOENIG wrote:

I assumes that there is no way to convert directly
"Pages &#x2019;06"
into
"Pages ₩06"


I'm getting slightly different results for Perl and Tcl.

set urichars to "Pages &#x2019;06"
do shell script "perl -MURI::Escape=uri_escape_utf8 -le 'print uri_escape_utf8(\"" & urichars & "\")'"
do shell script "tclsh <<< 'package require uri::urn;puts [uri::urn::quote {" & urichars & "}]'"

Look like the (new) Perl one is your best choice.

Well, no. With either choice, you're going to have to extract the unicode entities all by yourself :-)
The difference between the two is that Perl is escaping the semicolon. I'll have to check the RFC to see if that's necessary.


set urichars to "Pages &#x2019;06"
do shell script "perl -MURI::Escape=uri_escape_utf8 -le 'print uri_escape_utf8(\"" & urichars & "\")'"
--> "Pages ’06"

do shell script "tclsh <<< 'package require uri::urn;puts [uri::urn::quote {" & urichars & "}]'"
--> "Pages ’06"

Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Rép: Unicode versus Utf8
      • From: Emmanuel LEVY <email@hidden>
References: 
 >Rép: Unicode versus Utf8 (From: Yvan KOENIG <email@hidden>)
 >Re: Rép: Unicode versus Utf8 (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: Rép: Unicode versus Utf8
  • Next by Date: Fwd: Rép: Unicode versus Utf8
  • Previous by thread: Re: Rép: Unicode versus Utf8
  • Next by thread: Re: Rép: Unicode versus Utf8
  • Index(es):
    • Date
    • Thread