Hacker News new | ask | show | jobs
by beart 98 days ago
How do you safely convert a 2 byte character to a 1 byte character?
1 comments

Easily! If it doesn't convert successfully because it includes characters outside of the range of the target codepage then the equality condition is necessarily false, and the engine should short-circuit and return an empty set.