Comment

Comment by dahfizz

> Number of native (preferably UTF-8) code units

> The first is useful for basic string operations

Can you expand on this? I don't see why knowing the number of code units would be useful except when calculating the total size of the string to allocate memory. Basic string operations, such as converting to uppercase, would operate on codepoints, regardless of how many code units are used to encode that codepoint.

Converting 'Á' to 'á', for example, is an operation on one codepoint but multiple code units.

parent dahfizz 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton