You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consolidate UTF8 character encoding implementations #78490
We have two character encoding implementations for Utf8 <-> Utf16 <-> UCS4 in runtime; located at:
src/coreclr/pal/src/locale/{utf8,unicode}.cpp
src/mono/mono/eglib/giconv.c
The coreclr/pal implementation was ported from C# implementation in 2016: dotnet/coreclr#3809. The C# implementation has diverged / improved since with spanified and intrinsified APIs so much that the similarities between the two are unrecognizable.
We can move eglib/giconv.c from mono to src/native/minipal, and create a neutral C header, so both coreclr pal and mono glib can rely on unified APIs. There are also some unused methods in these files (e.g. g_utf8_to_ucs4_fast) which can be cleaned up at the same time.
@jeffhandley, it is not related to System.Text.Encodings.Web. This is about consolidating native implementations of encoding used internally by coreclr and mono. Managed libraries don't consume these implementations.
Activity
jkotas commentedon Nov 17, 2022
Sounds good to me. Make sure that the shared implementation is at least as fast as the current one.
We should not need that.
[-]Consolidate character encoding implementations[/-][+]Consolidate UTF8 character encoding implementations[/+]marek-safar commentedon Nov 17, 2022
/cc @SamMonoRT @lateralusX
am11 commentedon Nov 23, 2022
@jeffhandley, it is not related to System.Text.Encodings.Web. This is about consolidating native implementations of encoding used internally by coreclr and mono. Managed libraries don't consume these implementations.
jeffhandley commentedon Nov 23, 2022
Ah; thanks, @am11.