Fwd: Rép: Unicode versus Utf8
Fwd: Rép: Unicode versus Utf8
- Subject: Fwd: Rép: Unicode versus Utf8
- From: "Mark J. Reed" <email@hidden>
- Date: Sun, 5 Jul 2009 15:38:08 -0400
Replied only to Yvan
---------- Forwarded message ----------
From: "Mark J. Reed" <email@hidden>
Date: Sun, 5 Jul 2009 15:37:15 -0400
Subject: Re: Rép: Unicode versus Utf8
To: Yvan KOENIG <email@hidden>
Of course there is. Just pass the whole string in to either the Perl
or Tcl solution.
The only potentially tricky thing is the quoting, so I would feed the
string in as stdin instead of in the code. Try this:
do shell script "perl -MURI::Escape=uri_escape_utf8 -lne 'print
uri_escape_utf8($_)' <<<" & (quoted form of someString)
On 7/5/09, Yvan KOENIG <email@hidden> wrote:
> Oops,
> once again, I posted it to Philip Aker himself.
>
> Le 5 juil. 2009 à 19:46, Philip Aker a écrit :
>
>> On 2009-07-05, at 06:32:35, Mark J. Reed wrote:
>>
>>> And Philip: the win here is not so much Perl but the large set of
>>> useful modules that come preinstalled with it.
>>
>>
>> perl -= 1;
>> tclsh -= 1/2;
>>
>> Ok, I'm retracting the extra point for Perl, and instead, shaving
>> off 1/2 a point for the built-in Tcl extension package ::uri::urn
>> not advertising it's similar capability. Not to mention that the
>> proc is misnamed "quote" (rather than "escape").
>>
>> set urichars to "dörk"
>> do shell script "tclsh <<< 'package require uri::urn;puts
>> [uri::urn::quote {" & urichars & "}]'"
>
> Thanks to all of you.
>
> At this time I start from the original string :
> "Pages ’06"
> which I transform into "Pages ’06"
> then I extract "’"
>
> which I replace by Utf8value calculated with Philip's:
>
> set unicodeNum to "20A9" (* of course, it may be an other value *)
> set Utf8value to do shell script "perl -MURI::Escape=uri_escape_utf8 -
> le 'print uri_escape_utf8(chr(0x" & unicodeNum & "))'"
>
> I assumes that there is no way to convert directly
> "Pages ’06"
> into
> "Pages ₩06"
>
> Yvan KOENIG (from FRANCE dimanche 5 juillet 2009 20:38:00)
>
>
>
>
> _______________________________________________
> 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
>
--
Sent from my mobile device
Mark J. Reed <email@hidden>
--
Sent from my mobile device
Mark J. Reed <email@hidden>
_______________________________________________
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