Re: Rép: Unicode versus Utf8
Re: Rép: Unicode versus Utf8
- Subject: Re: Rép: Unicode versus Utf8
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 6 Jul 2009 07:08:58 -0400
You reverted to an old version of the command line that doesn't work.
Use the version in your previous message. The "-Mencoding=utf8" is
the important part you left out. Otherwise Perl misinterprets the
string that you're feeding it from Applescript.
The whole thing, again:
set mystr to "Pages ’09"
set escaped to (do shell script "perl -Mencoding=utf8
-MURI::Escape=uri_escape_utf8 -lne 'print uri_escape_utf8($_)' <<<" &
quoted form of mystr)
Which I just pasted from this message composer into osascript and it
worked correctly.
To go the other way requires one more module, since URI::Escape
doesn't have a uri_unescape_utf8 function:
set escaped to "Pages ’09"
set unescaped to (do shell script "perl -MEncode -Mencoding=utf8
-MURI::Escape -lne 'print decode_utf8(uri_unescape($_))' <<<" & quoted
form of escaped)
--
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