frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Unicode Footguns in Python

https://pythonkoans.substack.com/p/koan-15-the-invisible-ink
29•meander_water•1w ago

Comments

naIak•2h ago
I’m going to trigger some ptsd with this…

UnicodeDecodeError

morshu9001•2h ago
Unicode footguns, in Python
OkayPhysicist•2h ago
Frankly, the key takeaway to most problems people run into with Unicode is that there are very, very few operations that are universally well-defined for arbitrary user-provided text. Pretty much the moment you step outside the realm of "receive, copy, save, regurgitate", you're probably going to run into edge cases.
dhosek•2h ago
Grapheme count is not a useful number. Even in a monospaced font, you’ll find that the grapheme count doesn’t give you a measurement of width since emoji will usually not be the same width as other characters.
paulddraper•1h ago
Grapheme count (or rather, indexing) is necessary to do text selection or cursor positions.

Fortunately you can usually outsource this to a UI toolkit which can do it.

Spivak•1h ago
For certain use-cases, but it's not like any of the other usual notions of text length are any better for what you want.
renhanxue•2h ago
The article has good tips, but Unicode normalization is just the tip of the iceberg. It is almost always impossible to do what your users expect without locale information (different languages and locales sort and compare the same graphemes differently). "What do we mean when we say two strings are equal" can be a surprisingly difficult question to answer. It's practical too, not philosophical.

By the way, try looking up the standardized Unicode casefolding algorithm sometime, it is a thing to behold.

Groxx•2h ago
the normalization doc is interesting too imo: https://unicode.org/reports/tr15/

in particular, the differences between NFC and NFKC are "fun", and rather meaningful in many cases. e.g. NFC says that "fi" and "fi" are different and not equal, though the latter is just a ligature of the former and is literally identical in meaning. this applies to ffi too. half vs full width Chinese characters are also "different" under NFC. NFKC makes those examples equal though... at the cost of saying "2⁵" is equal to "25".

language is fun!

Longtime Mozilla Support Japanese Community Shuts Down over AI Translation Usage

https://support.mozilla.org/en-US/forums/contributors/717446
90•phantomathkg•51m ago•18 comments

Solarpunk is happening in Africa

https://climatedrift.substack.com/p/why-solarpunk-is-already-happening
597•JoiDegn•7h ago•301 comments

Recursive macros in C, demystified (once the ugly crying stops)

https://h4x0r.org/big-mac-ro-attack/
31•eatonphil•2h ago•6 comments

Dillo, a multi-platform graphical web browser

https://github.com/dillo-browser/dillo
245•nazgulsenpai•8h ago•91 comments

ChatGPT terms disallow its use in providing legal and medical advice to others

https://www.ctvnews.ca/sci-tech/article/openai-updates-policies-so-chatgpt-wont-provide-medical-o...
236•randycupertino•9h ago•222 comments

FAA to cut flights by 10% at 40 major airports due to government shutdown

https://www.cnbc.com/2025/11/05/faa-cuts-flight-capacity-shutdown.html
51•mikhael•45m ago•28 comments

Firefox profiles: Private, focused spaces for all the ways you browse

https://blog.mozilla.org/en/firefox/profile-management/
149•darkwater•1w ago•69 comments

The state of SIMD in Rust in 2025

https://shnatsel.medium.com/the-state-of-simd-in-rust-in-2025-32c263e5f53d
168•ashvardanian•8h ago•85 comments

New gel restores dental enamel and could revolutionise tooth repair

https://www.nottingham.ac.uk/news/new-gel-restores-dental-enamel-and-could-revolutionise-tooth-re...
361•CGMthrowaway•7h ago•151 comments

Why aren't smart people happier?

https://www.theseedsofscience.pub/p/why-arent-smart-people-happier
216•zdw•10h ago•332 comments

Rust's TUI Revolution

https://ratatui.rs/showcase/apps/
3•AbuAssar•39m ago•0 comments

The Basic Laws of Human Stupidity (1987) [pdf]

https://gandalf.fee.urv.cat/professors/AntonioQuesada/Curs1920/Cipolla_laws.pdf
50•bookofjoe•4h ago•15 comments

Ruby and Its Neighbors: Smalltalk

https://noelrappin.com/blog/2025/11/ruby-and-its-neighbors-smalltalk/
176•jrochkind1•12h ago•98 comments

A Lost IBM PC/at Model? Analyzing a Newfound Old Bios

https://int10h.org/blog/2025/11/lost-ibm-at-model-bios-analysis/
63•TMWNN•6h ago•10 comments

Carice TC2 – A non-digital electric car

https://www.caricecars.com/
189•RubenvanE•13h ago•143 comments

The shadows lurking in the equations

https://gods.art/articles/equation_shadows.html
259•calebm•13h ago•81 comments

Unicode Footguns in Python

https://pythonkoans.substack.com/p/koan-15-the-invisible-ink
30•meander_water•1w ago•8 comments

NY school phone ban has made lunch loud again

https://gothamist.com/news/ny-smartphone-ban-has-made-lunch-loud-again
222•hrldcpr•14h ago•168 comments

Radiant Computer

https://radiant.computer
172•beardicus•14h ago•130 comments

Vacuum bricked after user blocks data collection – user mods it to run anyway

https://www.tomshardware.com/tech-industry/big-tech/manufacturer-issues-remote-kill-command-to-nu...
185•toomanyrichies•4d ago•58 comments

An eBPF Loophole: Using XDP for Egress Traffic

https://loopholelabs.io/blog/xdp-for-egress-traffic
210•loopholelabs•1d ago•69 comments

Timing Wheels

https://pncnmnp.github.io/blogs/timing-wheels.html
33•pncnmnp•4d ago•0 comments

Gloomth

https://www.lrb.co.uk/the-paper/v47/n20/jon-day/gloomth
4•prismatic•6d ago•0 comments

I was right about dishwasher pods and now I can prove it [video]

https://www.youtube.com/watch?v=DAX2_mPr9W8
316•hnaccount_rng•1d ago•202 comments

I want a good parallel language [video]

https://www.youtube.com/watch?v=0-eViUyPwso
60•raphlinus•1d ago•33 comments

Absurd Workflows: Durable Execution with Just Postgres

https://lucumr.pocoo.org/2025/11/3/absurd-workflows/
105•ingve•2d ago•22 comments

App Store web has exposed all its source code

https://www.reddit.com/r/webdev/comments/1onnzlj/app_store_web_has_exposed_all_its_source_code/
189•redbell•2d ago•53 comments

SPy: An interpreter and compiler for a fast statically typed variant of Python

https://antocuni.eu/2025/10/29/inside-spy-part-1-motivations-and-goals/
235•og_kalu•6d ago•110 comments

Learning from failure to tackle hard problems

https://blog.ml.cmu.edu/2025/10/27/learning-from-failure-to-tackle-extremely-hard-problems/
104•djoldman•6d ago•22 comments

A P2P Vision for QUIC (2024)

https://seemann.io/posts/2024-10-26---p2p-quic/
88•mooreds•13h ago•40 comments