did-resolution icon indicating copy to clipboard operation
did-resolution copied to clipboard

`relativeRef` should prefer UTF-8 for percent encoding

Open aphillips opened this issue 3 months ago • 2 comments

DID Parameters https://www.w3.org/TR/did-resolution/#did-parameters

A relative URI reference according to RFC3986 Section 4.2 that identifies a resource at a service endpoint, which is selected from a DID document by using the service parameter. If present, the associated value MUST be an ASCII string and MUST use percent-encoding for certain characters as specified in RFC3986 Section 2.1.

The above requirement doesn't specify a specific character encoding to be used when percent-encoding URI-disallowed characters. Specifying that UTF-8 must be used would help interoperability. If the goal is to allow any octets to be transmitted, this should be made clear.

Note that the text does not say what the "certain characters" are. 3986 2.1 only specifies the percent-encoding mechanism, not what the characters are. A casual reader might assume that only ASCII characters are permitted, with the percent encoding reserved for problem characters like = that are also ASCII.

[!NOTE] An example later in the spec shows a relative reference that includes text that non-English users might reasonably expect to include non-ASCII data. https://www.w3.org/TR/did-resolution/#example-5

did:example:1234?service=files&relativeRef=%2Fmyresume%2Fdoc%3Fversion%3Dlatest ... where myresume, doc, version, and latest path elements might very reasonably use localized representations

aphillips avatar Sep 22 '25 15:09 aphillips

This was discussed during the #did meeting on 25 September 2025.

View the transcript

relativeRef should prefer UTF-8 for percent encoding #201

ottomorac: next one is our dear friend Relative Ref

<ottomorac> w3c/did-resolution#201

ottomorac: I don't know whether this is a discussion for next week (Weds)
… what do you think Will?

Wip: reading...

manu: Addison us usually right about this stuff. I think it's separate, unless we get rid of relativeRef, which I don't think we're likely to
… so, he's right that we should prefer UTF8 for percent encoding

Wip: the change we need to make is - somebody needs to make a PR stating that we prefer UTF8, yeah?

ottomorac: I can take that on, if it's just the clarification

manu: just to be clear, this is a MUST. if we want to help interop
… you MUST encode disallowed URL chars using UTF8

ottomorac: ok, so just make it a must statement

JoeAndrieu: we should make it clear that this is for ALL URL params, not just relativeRef

ottomorac: ok

<manu> +1 to what Joe said


w3cbot avatar Sep 25 '25 19:09 w3cbot

This was discussed during the #did meeting on 06 November 2025.

View the transcript

w3c/did-resolution#201

<ottomorac> This PR addresses #200, and #201 raised by Addison Phillips, regarding UTF8. It has some relationship to the DID path URL dereferencing, but wondering if we can have it merged before then?

<Wip> w3c/did-resolution#217

wip: I don't have anything about this, but I thought it was issue 217.

ottomorac: I referenced the PRs, not the issue.

<ottomorac> w3c/did-resolution#219

<ottomorac> w3c/did-resolution#215


w3cbot avatar Nov 06 '25 21:11 w3cbot