Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1135

Does c# use UTF-8 or UTF-16 for strings? [duplicate]

$
0
0

To be more precise, the latest version of c# (c# 12 (.NET 8.0)), does it use UTF-8 or UTF-16 for strings?

I am confused because:https://learn.microsoft.com/en-us/dotnet/standard/base-types/character-encoding-introduction

A string is logically a sequence of 16-bit values, each of which is an instance of the char struct.

And here:https://learn.microsoft.com/en-us/dotnet/core/compatibility/globalization/5.0/icu-globalization-api

.NET 5 and later versions use International Components for Unicode (ICU) libraries for globalization functionality when running on Windows 10 May 2019 Update or later.

And what if run on Linux? Do I have to provide the ICU lib?Or is the statement, c# still uses 16-bit values and deletes the zeros for all latin languages and maps this than to the ICU?


Viewing all articles
Browse latest Browse all 1135

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>