[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Comparison of URIs: Character encoding.

  • From: Mike Brown <mbrown@c...>
  • To: 'Alan Kennedy' <alank@x...>
  • Date: Mon, 27 Nov 2000 14:28:53 -0700

html form character encoding
> What character encoding should I use for encoding and decoding of
> escaped values in URIs?

See http://www.faqs.org/rfcs/rfc2396.html section 2.1
and http://www.faqs.org/rfcs/rfc2616.html section 3.2.2

Basically, RFC 2396 says that ASCII is used for %xx where xx is under 7F,
and that for non-ASCII characters it is a charset that is up to the scheme
and that there is no way to specify the charset in the URI.

Unfortunately, RFC 2616 (HTTP/1.1) doesn't address the
charset-in-%xx-encoded-URIs issue at all. The section I referred to just
addresses a more basic issue about comparison of ASCII-based URIs.

http://www.w3.org/TR/html401/appendix/notes.html#h-B.2.1 recommends that
HTML user agents, when interpreting URIs that appear in HTML attribute
values, assume UTF-8 by default, falling back on the encoded document's
charset if the URI doesn't resolve. But this only affects URIs that are
referenced in HTML documents.

Also, HTML user agents tend to submit HTML form data with the URL-encoding
based on the charset of the encoded document, possibly overridden by the
user, so if you're looking at a URI that was generated for an HTML form
submission, you can't assume that the %80-%FF sequences are necessarily
UTF-8.

Section 2.2 of http://www.faqs.org/rfcs/rfc2141.html says that in a URN, the
%xx sequences *definitely* represent UTF-8 octets. However, the urn scheme
has nothing to do with the http scheme.

That's the best I can do...

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at            My XML/XSL resources:
webb.net in Denver, Colorado, USA              http://skew.org/xml/

  • Follow-Ups:
    • SVG ?
      • From: "Manos M. Batsis" <manosb@p...>

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.