OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

cgmo-webcgm message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [cgmo-webcgm] implications of URI vs. IRI


All,

I am not yet convinced that we are heading in the right direction here.

Example:
Let's assume we have the string "nihon" inside a linkUri: "id(ÈÕ±¾)"

using UTF-16 (big endian) this is: 65 e5 67 2c (4 Bytes)
converted to UTF-8: EF BB BF E6 97 A5 E6 9C AC (9 Bytes)

and then you can apply escaping for all non-ascii chars

%EF%BB%BF%E6%97%A5%E6%9C%AC (27 Bytes)

and now we store it into the linkURI attribute, however, since
somewhere else in the file we have this string in japanese characters
as an ID, all non-graphical strings will be stored as UTF-16 (could be
UTF-8 as well):

I save the writing, you end up with 54 bytes.

So we are moving from 4 bytes to 54 bytes.

I hope that this accurately describes the procedure that has been discussed
over the past couple of days.

Comparison to SVG:
In 5.3.2. [1], SVG says the following:

"The value of the href attribute must be a URI reference as defined in
[RFC2396], or must result in a URI reference after the escaping procedure
described below is applied. The procedure is applied when passing the URI
reference to a URI resolver."

Interesting to see the last sentence here. IMO this means, it is perfectly
legal to store the URI reference using any encoding, as long as it will be
transcoded to UTF-8 and escaped before passing it on to a URI resolver.

This has always been my understanding, and this is how all of our products
have been handling references.

NOTE:
If we required an escaped string inside the CGM now, this will make almost
all existing files invalid ones as soon as a simple space is in a name
attribute.

RECOMMENDATION:
Amend wording slightly to match watch SVG is doing and allow for both
styles, escaped and not escaped.

Comments?

Regards,
Dieter


[1] http://www.w3.org/TR/SVG11/struct.html#xlinkRefAttrs


> -----Original Message-----
> From: Lofton Henderson [mailto:lofton@rockynet.com] 
> Sent: Wednesday, October 05, 2005 1:06 AM
> To: Benoit Bezaire; cgmo-webcgm@lists.oasis-open.org
> Subject: Re: [cgmo-webcgm] implications of URI vs. IRI
> 
> At 05:09 PM 10/4/2005 -0400, Benoit Bezaire wrote:
> >Hi Lofton,
> >
> >I just did a quick search... I think that URI is only restricting 
> >characters to US-ASCII; it has no control on the encoding (utf-8,
> >utf-16 etc...).
> >
> >In XML syntax such as XHTML and SVG, files can have just about any 
> >encoding; I'm not aware of any special processing for the xlink:href 
> >attribute (i.e., this is a URI, change the encoding to _blah_). It 
> >wouldn't make any sense. The scope of the encoding is for 
> the complete 
> >document.
> >
> >The above is not a fact, only my understanding.
> 
> It matches my understanding.  And it is clear that XML and/or 
> URI (rfc3986) require "URI escaping" for non-ASCII characters 
> in URIs, i.e., for character that are outside of the ASCII 
> repertoire.  And this is independent of the character-set 
> encoding of the URI.
> 
> So finally, a URI from HTML into CGM containing a 
> reference-by-name to "my object group" would be written like this:
> 
> <a 
> href="http://example.org/myCGM.cgm#name(my%20object%20group)">blah</a>
> 
> and a WebCGM 'linkuri' first parameter would be this:
> 
> http://example.org/myCGM.cgm#name(my%20object%20group)
> 
> -Lofton.
> 
> 
> >Tuesday, September 20, 2005, 2:45:48 PM, Lofton wrote:
> >
> >LH> All --
> >
> >LH> When I was putting together first unicode tests, Dieter also 
> >LH> supplied me with this nifty "advanced" test.  It gets 
> into Japanese 
> >LH> text for SF text like APS ids and names.
> >
> >LH> It highlights an interesting implication of our decision 
> to stick 
> >LH> with URI instead of switching to IRI.  URI encoding 
> requires that 
> >LH> any non-ASCII characters are included by the "URI escaping 
> >LH> mechanism", see WebCGM
> >3.1.1.4
> >LH> [1], and the more detailed XML description [2].  
> Basically, get the
> >LH> **UTF8** representation of the characters, and replace 
> each byte in 
> >LH> that representation by the 3-character string %HH, where 
> HH is the 
> >LH> hex representation of the byte.
> >
> >LH> So suppose consider for example the 2-character id of 
> the object in 
> >LH> the upper-left box, and its use in a link from the object in the
> >upper-right box.
> >
> >LH> If that id were the two characters c1c2, lets suppose 
> that it could 
> >LH> be represented by the 4 utf8 bytes b1b2b3b4 (I'm just guessing 
> >LH> about "4", since UTF8 is variable length, it could be 
> more).  Then 
> >LH> to put that id
> >into
> >LH> a URI string, it would have to be the 12-character string:
> >
> >LH> %hh%hh%hh%hh
> >
> >LH> where the hh are the are the 4 pairs of hex digits that 
> represent 
> >LH> the 4
> >LH> utf16 bytes. I.e., the CGM URI for the link would be:
> >
> >LH> #id(%hh%hh%hh%hh, view_context)
> >
> >LH> Side question.  Does URI (rfc3986 [3]) restrict only the 
> character 
> >LH> repertoire of the URI, or does it restrict also the 
> encoding? I.e., 
> >LH> can a URI be encoded in ascii, isoLatin1, or utf8, or utf16, or 
> >LH> whatever, as
> >long
> >LH> as it restricts its repertoire to the URI repertoire?  I suspect
> >"yes", but
> >LH> I don't know the answer.  It would be interesting for someone to
> >research it.
> >
> >LH> Thoughts?
> >
> >LH> Regards,
> >LH> -Lofton.
> >
> >LH> [0]
> >LH> 
> http://docs.oasis-open.org/webcgm/v2.0/WebCGM20-IC.html#webcgm_3_1_
> >LH> 1_4 [1] 
> >LH> http://www.w3.org/TR/2004/REC-xml-20040204/#sec-external-ent
> >LH> [3] URI:  http://www.ietf.org/rfc/rfc3986.txt
> >LH> [4] IRI:  http://www.ietf.org/rfc/rfc3987.txt
> 
> 
> 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]