2 ms·
Space is always a concern, and encodings should largely be transparent to your application unless you're writing something like a rendering engine. Consider th
by camgunz 7y ago
Space is always a concern, and encodings should largely be transparent to your application unless you're writing something like a rendering engine.
Consider things like databases (relational/document/key-value/etc.), JSON payloads, compression algorithms, battery life, etc. etc.
There is a problem with lots of developers assuming UTF-16 is fixed-width (just look at this thread), but that's a mistake for any UTF encoding, and it's almost always a mistake in any encoding--you shouldn't be indexing into strings.
People say, "just use UTF-8, you never have to worry about it and it's ASCII compatible", but you shouldn't be using the ASCII compatibility (arguably this is an anti-feature) and you shouldn't have to worry about the details like BOM because you're using your language's built-in string support or a library right?