Top all-time · #1620
Henri Sivonen
Personal blog · hsivonen.fiprogrammingwebsystems
Henri Sivonen's personal blog at hsivonen.fi covers programming, web and systems. Since 2013, 47 different Hacker News readers have linked it 67 times, most often “String Lengths in Unicode”. The last post was in 2022, but the archive is still widely read.
Most-linked posts?
- String Lengths in Unicode14 people · 14 mentions · first linked 2019-09-09
- Chardetng: A More Compact Character Encoding Detector for the Legacy Web4 people · 4 mentions · first linked 2020-06-08
- Why Supporting Unlabeled UTF-8 in HTML on the Web Would Be Problematic3 people · 5 mentions · first linked 2020-02-20
- /png-gamma/3 people · 3 mentions · first linked 2015-09-10
- /eme/3 people · 3 mentions · first linked 2014-01-15
- How I Wrote a Modern C++ Library in Rust3 people · 3 mentions · first linked 2018-12-03
- The Text Encoding Submenu Is Gone2 people · 2 mentions · first linked 2021-08-24
- How to Avoid Being Called a Bozo When Producing XML (2005)2 people · 2 mentions · first linked 2014-02-27
- Activating Browser Modes with Doctype2 people · 2 mentions · first linked 2014-10-28
- How many replacement characters?2 people · 2 mentions · first linked 2017-05-31
What Hacker News says?
> The argument for DRM is that it ships in a sandbox built by Mozilla. Actually, I was long since wondering how exactly that sandbox works, so if you have some more information about that, I'd appreciate it. Henri Sivonen's general explanation of EME and CDMs[1] tells the following: > A CDM could be bundled with the browser, downloaded separately, bundled with the operating system, embedded in hardware as firmware r…
Comment linking /eme/
on “Mozilla lays off 250 employees while it refocuses on commercial products”Submitted How I Wrote a Modern C++ Library in Rust as a story · 406 points
HN discussion> Why can't we assume UTF-8 unless told otherwise? See https://hsivonen.fi/utf-8-detection/
Comment linking /utf-8-detection/
on “My Current HTML Boilerplate”Submitted String Lengths in Unicode as a story · 230 points
HN discussion> in the case of offline where there are no http headers, the browser works out what encoding to use For file: URLs, Firefox and, a bit less reliably, Chrome do work out that an HTML file is UTF-8. Safari does not. > And since utf-8 is the only valid charset for HTML5 Correct. > it should be the default. It isn't. See https://hsivonen.fi/utf-8-detection/ for why. Having <meta charset="UTF-8"> in the boilerplate is g…
Comment linking /utf-8-detection/
on “My Current HTML Boilerplate”Submitted It’s not wrong that "\u{1F926}\u{1F3FC}\u200D\u2642\uFE0F".length == 7 (2019) as a story · 195 points
HN discussion> Note that they are not actually removing any encodings themselves, so the argument from security / attack surface doesn't arise: the website can still send text in any of those encodings (or malformed but autodetected as such). No. If the visitor is able to freely choose the page encoding, then the attacker can lure one into doing so by presenting a seemingly malformed partial text. So it will allow the attacker t…
Comment linking /encoding-telemetry/
on “I have no capslock and I must scream”Submitted String length functions for single emoji characters evaluate to greater than 1 as a story · 116 points
HN discussionIf a site with an EV cert is being spoofed using a similar-looking domain name and a DV cert, how realistically is the user going to remember that the real site is supposed to have an EV cert? (Besides just maybe remembering it for Paypal in particular.) See also the Nordea section at https://hsivonen.fi/bank-idp/ . How is a user supposed to form a mental model about multi-server org who don't use EV consistently?
Comment linking /bank-idp/
on “Intent to Deprecate and Remove: Trust in Existing Symantec-Issued Certificates”Submitted How to Avoid Being Called a Bozo When Producing XML (2005) as a story · 107 points
HN discussion> Could you please describe a bit more about the browser-CDM interaction and what is implemented there? I don't really know what this interaction looks like in non-Firefox browsers. Last I checked, the CDMs Chrome ships didn't work with Chromium, but I don't know whether that's still true, and I don't know whether the browser-side bits involved are implemented at all in Chromium or just in Chrome. Likewise, I don't…
Comment linking /eme/
on “Save Firefox”Submitted How many replacement characters? as a story · 93 points
HN discussionI think the current approach is to just invent yet another "meta layer" of characters and declare that this particular sequence of bytes/codepoints/surrogate pairs/grapheme clusters/extended grapheme clusters/zwj sequences/whatever else you can think of has a special meaning and does not behave like you think it does. See also Henri Sivonen's essay on unicode string length [1] So in a way, Unicode is already long pa…
Comment linking /string-length/
on “U+237C ⍼ Right Angle with Downwards Zigzag Arrow”Submitted Chardetng: A More Compact Character Encoding Detector for the Legacy Web as a story · 63 points
HN discussionhttps://hsivonen.fi/eme/ explains what EME is . Granted, it might not explain "what is going on".
Comment linking /eme/
on “Requirements for DRM in HTML are confidential”Submitted Activating Browser Modes with Doctype as a story · 33 points
HN discussionI think Acid2 was partly responsible for this. See https://hsivonen.fi/last-html-quirk/
Comment linking /last-html-quirk/
on “Google HTML/CSS Style Guide – Omit Optional Tags”Submitted It’s Not Wrong that “ ”.length == 7 as a story · 20 points
HN discussionhttps://news.ycombinator.com/item?id=23290506 https://coaxion.net/blog/2017/09/exporting-a-gobject-c-api-f... https://hsivonen.fi/modern-cpp-in-rust/ http://hansihe.com/2017/02/05/rustler-safe-erlang-elixir-nif...
Comment linking /modern-cpp-in-rust/
on “Chromium project finds that 70% of security defects are memory safety problems”Submitted IME Smoke Testing as a story · 7 points
HN discussionIt is up to the implementation. This is a good read on aspects of it: https://hsivonen.fi/string-length/
Comment linking /string-length/
on “Emoji Under the Hood”Submitted What is EME? as a story · 5 points
HN discussion> e.g. removed C++ code that has later found to have bugs The article links to a longer article ( https://hsivonen.fi/encoding_rs/ ) about encoding_rs. The longer article mentions a bug that got fixed in Firefox ESR after the code had been replaced with encoding_rs in non-ESR Firefox. (I wrote the bug, too, though.) > or newly re-written crates now more useful to the wider community than the same code locked up in C…
Comment linking /encoding_rs/
on “How I Wrote a Modern C++ Library in Rust”Submitted A string containing one emoji has length == 7 in JS and 17 in Rust as a story · 4 points
HN discussionFor writing globally appropriate software, UTF-8 is the best option that exists in practice. Note that “Asian” is quite a gamut in terms of UTF-8 size: Chinese is at the very compact end of the spectrum and the Burmese script at the other end: https://hsivonen.fi/string-length/#counts
Comment linking /string-length/
on “Hacking GitHub's Auth with Unicode's Turkish Dotless 'I'”Submitted The Joy of about:blank as a story · 4 points
HN discussionYou can use FF as a sentinel byte internally (I think utf8proc actually does that?); given that FE never occurs, either, if you see the byte sequence corresponding to U+FEFF BYTE ORDER MARK in one of the other UTFs you can pretty much immediately tell it can’t possibly be UTF-8. (In general UTF-8, because of all the self-synchronization redundancy, has a very distinctive pattern that allows it to be detected with al…
Comment linking /utf-8-detection/
on “How UTF-8 Works”Submitted Chardetng: A More Compact Character Encoding Detector for the Legacy Web as a story · 3 points
HN discussionThe polyglot syntax gets weird in CDATA elements and you have to add a bunch of talismans to the code. If you don't want to accidentally break it you shouldn't be writing XML by hand or gluing it from strings ( https://hsivonen.fi/producing-xml/ ), so you need to output only using polyglot-compatible XML+HTML serializer. That's a lot of work for case when maybe somebody will parse your markup as XML? All bots suppor…
Comment linking /producing-xml/
on “To close or not to close – Void HTML elements”Submitted Text Encoding Menu in 2021 as a story · 3 points
HN discussion