Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

Specify HTML numeric character reference fallback encoding for multipart upload filename characters not representable in form charset #3223

Closed

Description

@bsittler

Specify HTML numeric character reference fallback encoding for multipart upload filename characters not representable in form acceptCharset/form charset.

Rationale:

  • Consistency: this will make filename fallback character replacement consistent with encoding of form element names and values in multipart uploads when a source character is not representable in the acceptCharset/form charset. @annevk points out that this is exactly the "html" error handling of the Encoding Standard. https://encoding.spec.whatwg.org/#concept-encoding-process
  • Predictability: this is consistent with existing behavior in at least two browsers (Firefox and Edge). I have also started an intent to implement and ship thread for this behavior for Chrome. edit: this proposal was accepted, I'm now working to implement it in Chrome
  • Reduced data loss: this change reduces the risk of user confusion and website malfunction when multiple uploaded files with distinct local filenames but identical representation after user agent-specific fallback character replacement are uploaded using <input type=file multiple>; with this behavior standardized, web pages may even be able to portably recover useful user-visible representations of the original filenames, though some ambiguity remains with that approach as a local file could actually contain name parts matching numeric character references (moving to UTF-8 for the form submission of course resolves the ambiguity and should be the only recommended solution for newly-built web pages).

Accidentally filed here too: w3c/html#1077

Activity

  1. annevk commented on Nov 14, 2017

    @annevk
    Member

    Currently we have:

    For each character in the entry's name and value that cannot be expressed using the selected character encoding, replace the character by a string consisting of a U+0026 AMPERSAND character (&), a U+0023 NUMBER SIGN character (#), one or more ASCII digits representing the code point of the character in base ten, and finally a U+003B (;).

    If we use https://encoding.spec.whatwg.org/#encode this will happen automatically. The problem is that HTML passes strings to the RFC "algorithms" which are supposed to handle all the encoding requirements.

    A proper fix would require replacing the RFC I think.

  2. annevk commented on Nov 14, 2017

    @annevk
    Member
  3. bsittler commented on Nov 14, 2017

    @bsittler
    Author

    An example: if the filename were ABC~‾¥≈¤・・•∙·☼★星🌟星★☼·∙•・・¤≈¥‾~XYZ&#8776;.txt and the form charset were ISO-2022-JP the expected encoded name would be ABC~⊖(J~\&#8776;&#164;⊖$B!&!&⊖(B&#8226;&#8729;&#183;&#9788;⊖$B!z@1⊖(B&#127775;⊖$B@1!z⊖(B&#9788;&#183;&#8729;&#8226;⊖$B!&!&⊖(B&#164;&#8776;⊖(J\~⊖(B~XYZ&#8776;.txt a.k.a. ABC~␛(J~\&#8776;&#164;␛$B!&!&␛(B&#8226;&#8729;&#183;&#9788;␛$B!z@1␛(B&#127775;␛$B@1!z␛(B&#9788;&#183;&#8729;&#8226;␛$B!&!&␛(B&#164;&#8776;␛(J\~␛(B~XYZ&#8776;.txt (here ⊖ or ␛ pictorially represents the ESC C0 control x1B); beware the information-losing unification of halfwidth and fullwidth forms, in addition to the information loss due to inability to distinguish literal and replacement numeric character reference-like sequences; the actual solution to those problems is UTF-8, but so long as non-UTF-8 charsets are still used this will at least reduce information loss compared to e.g. ? substitution.

  4. bsittler commented on Dec 6, 2017

    @bsittler
    Author

    Given that this issue is still open, should the tests I'm adding in https://crrev.com/c/811625 be .tentative. ?

  5. domenic commented on Dec 6, 2017

    @domenic
    Member

    Yeah. Were you interested in updating the spec too?

  6. bsittler commented on Dec 6, 2017

    @bsittler
    Author

    Sure! How does a non-editor do that? Edit: n/m, I see CONTRIBUTING.md now

  7. bsittler commented on Dec 6, 2017

    @bsittler
    Author

    @annevk @domenic I have attempted to change HTML to match in #3276 - would you be suitable reviewers?

  8. added a commit that references this issue on Dec 7, 2017
  9. annevk commented on Mar 1, 2021

    @annevk
    Member

    @andreubotella ended up fixing this in #6282.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions