Reputation: 71
I guess .net uses UTF 16 for string encoding.
UTF 8
the footprint would reduce to half.Upvotes: 2
Views: 6845
Reputation: 498904
No need to guess. It does indeed use UTF-16 internally (see the remarks section of the Char
Structure page on MSDN).
You can't change how .NET handles strings internally.
If you need to change the encoding for output, use the Encoding
class, in particular, for UTF-8 you can simply use the static property Encoding.UTF8
.
I understand wanting to save the space, but perhaps you need to rethink the application design and have these strings externally (i.e. loaded from the filesystem or a database) and not compiled into the application?
Upvotes: 10