Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The concept of "output encoding" is not described anywhere #291

Open
Mingun opened this issue Aug 20, 2022 · 5 comments
Open

The concept of "output encoding" is not described anywhere #291

Mingun opened this issue Aug 20, 2022 · 5 comments

Comments

@Mingun
Copy link

Mingun commented Aug 20, 2022

Currently a paragraph about it gives no idea what is "output encoding" and why it is needed:

encoding/encoding.bs

Lines 733 to 746 in 4f549cd

<h3 id=output-encodings>Output encodings</h3>
<p>To <dfn export>get an output encoding</dfn> from an <a for=/>encoding</a>
<var>encoding</var>, run these steps:
<ol>
<li><p>If <var>encoding</var> is <a>replacement</a> or <a>UTF-16BE/LE</a>, then return
<a>UTF-8</a>.
<li><p>Return <var>encoding</var>.
</ol>
<p class=note>The <a>get an output encoding</a> algorithm is useful for URL parsing and HTML
form submission, which both need exactly this.

It would be good to describe what it is, what problems it solves and where you should use it.

@annevk
Copy link
Member

annevk commented Aug 23, 2022

Doesn't the note address that?

@Mingun
Copy link
Author

Mingun commented Aug 23, 2022

I think no. At least for me it is still unclear. For example, percent-decoding algorithm is also useful for URL parsing, but that does not explain, why URL can be percent-encoded.

@annevk
Copy link
Member

annevk commented Aug 23, 2022

The respective encodings don't have a defined encoder and the reason these older features use legacy encodings to encode is mainly an accident of history. I suppose I'd support an amendment of the note to that effect.

@Mingun
Copy link
Author

Mingun commented Aug 23, 2022

The respective encodings don't have a defined encoder

Well, that's a recursive explanation. Why they don't have a defined encoder? Why did someone decide that if we could not encode the text in one encoding, then some other would be suitable for us? It looks absurd! I.e. we tell the recipient that we have one encoding and are actually encoded into another. Or we definitely know that the consumer expects one specific encoding, we try to encode into it... and get a text encoded in other encoding instead of error explaining that this encoding is unsupported. I have no idea what scenario of use such a substitution has. Can this be explained in the specification together with examples when this can be needed?

@annevk
Copy link
Member

annevk commented Aug 24, 2022

That's a different question though and would better be addressed elsewhere. The answer is that none is needed for the web.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants