Coder Social home page Coder Social logo

Comments (21)

domenic avatar domenic commented on August 12, 2024

/cc @cdumez who I noticed recently updated WebKit's encoding labels in WebKit/WebKit@f203fd0

I assume it would be a bad option to rename "replacement" to something like, say, "csiso2022kr"?

from encoding.

cdumez avatar cdumez commented on August 12, 2024

@domenic Despite having done the update in WebKit recently, I am actually not familiar with this area enough to comment. I know that we do have the "replacement" label for the replacement encoding in WebKit though.

from encoding.

hsivonen avatar hsivonen commented on August 12, 2024

I know that we do have the "replacement" label for the replacement encoding in WebKit though.

Are you sure? Testing indicates otherwise.

from encoding.

hsivonen avatar hsivonen commented on August 12, 2024

I assume it would be a bad option to rename "replacement" to something like, say, "csiso2022kr"?

That would be pretty confusing, so I think that's a bad option.

from encoding.

cdumez avatar cdumez commented on August 12, 2024

@hsivonen: I wrote the patch very recently so you would need to try a WebKit nightly build.

from encoding.

annevk avatar annevk commented on August 12, 2024

@cdumez someone did try a nightly. It appears that WebKit (per spec and other browsers) does not alias "replacement" to the behavior of the replacement encoding.

from encoding.

cdumez avatar cdumez commented on August 12, 2024

Oh my bad, there was some last minute review feedback on my patch and it appears it killed the replacement alias. Sorry about the bad information.

from encoding.

annevk avatar annevk commented on August 12, 2024

We added replacement in https://www.w3.org/Bugs/Public/show_bug.cgi?id=21057. I don't think we really discussed adding it as a label before. I'm certainly open to adding it as it does simplify the system a little bit, but also not a whole lot.

@jungshik thoughts?

from encoding.

inexorabletash avatar inexorabletash commented on August 12, 2024

FWIW, I concur with the OP - frequent special cases in the code and tests, but sad about adding it to the web just to make implementations cleaner. So no vote either way.

from encoding.

annevk avatar annevk commented on August 12, 2024

I'm going to close this since everyone is on the fence. Feel free to reopen though if you feel strongly since it doesn't seem like it would be a hard sell.

from encoding.

annevk avatar annevk commented on August 12, 2024

I'm going to reopen this to add "replacement" as a label as the special cases apparently continue to cause problems (at least in Gecko while integrating encoding-rs) for no real gain.

As nobody objected and @hsivonen now favors this approach I hope that is acceptable, but I'll leave some time for feedback just in case.

from encoding.

annevk avatar annevk commented on August 12, 2024

I'm surprised this is such a big deal in code as there's nothing in the standard (or any standards that use this standard) to my knowledge that trips over this.

Nevertheless, I created the PR, review appreciated. Note that before landing it I should probably:

  1. Update tests.
  2. File bugs against Firefox, WebKit, and Chromium. Not sure about Edge as they haven't made an effort to comply thus far I think.

from encoding.

domenic avatar domenic commented on August 12, 2024

Shouldn't we get another implementation interested before landing?

from encoding.

annevk avatar annevk commented on August 12, 2024

I considered @inexorabletash's reply above as such, but happy to wait for something more explicit.

from encoding.

inexorabletash avatar inexorabletash commented on August 12, 2024

It involves deleting code on our side so I'm okay with the change.

from encoding.

inexorabletash avatar inexorabletash commented on August 12, 2024

FWIW, I put up a Blink change: https://chromium-review.googlesource.com/c/559973/ - I'll wait for test updates to hit WPT and roll into Blink, though.

Sanity check: we would now expect an HTML file with <meta http-equiv="content-type" content="text/html; charset=replacement"> to render as � yes?

from encoding.

annevk avatar annevk commented on August 12, 2024

@inexorabletash yeah, that wouldn't be any different from it saying iso-2022-kr or some such. Note that it would have to appear within the first 1024 bytes.

@hsivonen do you want to review the change?

from encoding.

annevk avatar annevk commented on August 12, 2024

Bugs:

To my knowledge Edge hasn't made an effort yet so I'm not including them for now.

from encoding.

domenic avatar domenic commented on August 12, 2024

https://developer.microsoft.com/en-us/microsoft-edge/platform/status/encodingstandard/ lists them as "In Development" so they might appreciate a bug.

from encoding.

inexorabletash avatar inexorabletash commented on August 12, 2024

FYI, Blink change landed.

Worth noting: @annevk's WPT changes didn't trip any failures when rolled into Blink's CI since the tests currently exercise the encoding labels via the API, and replacement encodings already threw just like unknown labels.

We've got blink-specific tests that use XHR and data: URLs to verify various encodings and specifically that the replacement ones yield U+FFFD. I was lazy and just added "replacement" to the list. We should probably tidy up and upstream those (among other fun cases like UTF-7).

from encoding.

annevk avatar annevk commented on August 12, 2024

@inexorabletash yeah, that would be great.

Filed https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12808940/ against Edge.

from encoding.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.