[Mono-dev] [Dotnet-runtime-dev] ASCII Strings Proposal

Miguel de Icaza miguel.de.icaza at gmail.com
Thu Jul 28 14:08:46 UTC 2016


>
>
> > > For historical reasons, System.String uses the UCS-2 character
> encoding,
> > that is, UTF-16 without surrogate pairs.
> >
> > > However, most strings in typical .NET applications consist solely of
> ASCII
> > characters, leading to wasted space: half of the bytes in a string are
> likely to
> > be null bytes!
>
> What's wrong with UTF-8?
>

Nothing is wrong, but in .NET we surface a string indexer, and it has
constant time properties.

UTF-8 needs to be parsed to be indexed, while neither ascii, nor the
UTF-16/surrogate-pair encoding (what .NET uses) has this.

Miguel.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/mono-devel-list/attachments/20160728/c68c808e/attachment.html>


More information about the Mono-devel-list mailing list