[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

=?iso-8859-1?Q?RE:_=5Bxsl=5D_url_encoding_gets_wrong_with_=E5=F6=E4=3F?=


Subject: RE: [xsl] url encoding gets wrong with åöä?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 7 Jun 2006 12:03:47 +0100

This thread seems to have gone off at a complete tangent.

(a) There are any number of editors that handle iso-8859-1 on Windows, or at
any rate cp-1252 which is a good enough approximation for present purposes.
This isn't the issue.

(b) Calling an extension function to do URL encoding is a perfectly
reasonable thing to do if you want to achieve something that the standard
XSLT-generated encoding doesn't do. However, the suggestion that the
encoding used by the extension function depends on the encoding of the
stylesheet containing the call to the extension function seems pretty
implausible.

In fact, the one-argument form of java.net.URLEncoder.encode() uses the
default encoding of the platform, and is deprecated for that reason. There
is a two-argument form in which the second argument is the encoding you want
to use, for example "UTF-8" or "ISO-8859-1". The documentation of this
method states clearly:

Note: The  World Wide Web Consortium Recommendation states that UTF-8 should
be used. Not doing so may introduce incompatibilites.

None of this gets to the root of the problem, which is why percent-encoding
the URL using UTF-8 encoding, as specified in all the standards, isn't
working in your case. In general, it's a good idea to understand a problem
before you start groping around in a blind search for a workaround.

Michael Kay
http://www.saxonica.com/


> -----Original Message-----
> From: Abel Braaksma Online [mailto:abel.online@xxxxxxxxx]
> Sent: 07 June 2006 11:47
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] url encoding gets wrong with evd?
>
> Hi Niklas,
>
> Eclipse is free: www.eclipse.org. It is a development
> environment and it can help you with developing XML, XSLT and
> programming (if you'd need it). You can find any nice text
> editor in this list:
> http://en.wikipedia.org/wiki/List_of_text_editors. Decide
> which you want based on it's capability of viewing a
> text-only document in different encodings.
>
> As a matter of fact, you can judge the encoding of your
> document by loading into Internet Explorer (as a .txt file)
> and choose some different encodings from the View -->
> Encoding menu. A handy shortcut I often find myself using
> when I have to find out what encoding / language a text is in
> (I do business with some Baltic states, have a different
> character map than your Latin-1).
>
> Cheers,
> Abel
>
> Niklas Holmberg wrote:
>
> >I don't have eclipse. Anybody know a good editor (for
> windows) that can save correct ISO-8859-1 documents?


Current Thread
Keywords