Re: URL encode trouble
Re: URL encode trouble
- Subject: Re: URL encode trouble
- From: Arthur J Knapp <email@hidden>
- Date: Sun, 19 May 2002 13:29:06 -0400
>
Date: Sat, 18 May 2002 18:13:53 +0200
>
Subject: URL encode trouble
>
From: JJ <email@hidden>
>
I'm trying url-encoding this char: "a"
>
and I get allways "‡"
I'm on the character-mangling-digest, so I'm going to assume that you
typed a-acute.
>
But if I search at (e. g.) "Google" this string "a", it is passed to the
>
remote stream as "á".
>
Finally, the question:
>
Why both "E1" & "87" are the same character "a"? Are they different kinds or
>
methods of URL encoding?
Characters whose character-set number is 128 or greater are different
for different kinds of computers. Hex 87, (decimal 135), is the exact
location for a-acute on a Macintosh. Hex E1, (decimal 225), is the
representation of lowercase a with an acute accent in a standard called
the ISO Latin 1 Characters, (also simply ISO 8859-1). Web browsers,
(especially the older ones), do not always handle these escape-sequences
correctly. In fact, there are some characters in ISO Latin 1 that simply
are not handled by the Macintosh character-set, such as superscripts 1, 2
and 3; fractions 1/4, 1/2, and 3/4; the formal multiplication sign that
looks like an "X"; etc.
P.S. I apologize if anything I have said above is different for users
of non-US Macintoshes.
>
And, do you know a quick AS solution to translate "a" to "E1" (not "87")?
I don't know if anyone has created a Scripting Addition for conversion
to ISO 8859-1. I could create a vanilla conversion handler, it would just
be a question of creating a map between the high-bit characters of the
Macintosh standard character set and the ISO standard. We would also have
to decide how to handle a character that exists in one character set but
not in the other.
If you have BBEdit, you can use the menu command
Markup
Utilities
Translate
This is also scriptable:
tell application "BBEdit 6.1C"
(* Encodes all high-bit characters of frontmost document:
*)
translate text to html entity conversion (true) ,
entity encoding method (entity hex value) ,
create new document (false)
end tell
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
<
mailto:email@hidden>
try
<
http://www.seanet.com/~jonpugh/>
on error number -128
end try
}
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.