-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
X509Certificate2.GetNameInfo(SimpleName) with non-ASCII data on Linux returns oddly encoded results. #59105
Comments
Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @GrabYourPitchforks Issue DetailsVerified on Ubuntu 18.04 with .NET Core 3.1 and .NET master from a couple months ago.
Expect: Something Russian e.g.
(https://iitrust.ru/downloads/ca/guc2021.crt) The subject CN is GetNameInfo is returning
|
@bartonjs do you want me to look in to this or is this something you are currently investigating? |
Eh, I figured it out. PR coming soon. |
Wow. Nice work. Always impressed when "go to lunch" somehow means stuff's done 😄. |
Verified on Ubuntu 18.04 with .NET Core 3.1 and .NET master from a couple months ago.
Expect: Something Russian
Actual: A string escaped in with backslash-capital-Us.
e.g.
(https://iitrust.ru/downloads/ca/guc2021.crt)
The subject CN is
Минкомсвязь России
, encoded as0C 23 D0 9C D0 B8 D0 BD D0 BA D0 BE D0 BC D1 81 D0 B2 D1 8F D0 B7 D1 8C 20 D0 A0 D0 BE D1 81 D1 81 D0 B8 D0 B8
GetNameInfo is returning
\U041C\U0438\U043D\U043A\U043E\U043C\U0441\U0432\U044F\U0437\U044C \U0420\U043E\U0441\U0441\U0438\U0438
, and passing that to Encoding.UTF8.GetBytes says it's not a console problem:5C 55 30 34 31 43 5C 55 30 34 33 38 5C 55 30 34 33 44 5C 55 30 34 33 41 5C 55 30 34 33 45 5C 55 30 34 33 43 5C 55 30 34 34 31 5C 55 30 34 33 32 5C 55 30 34 34 46 5C 55 30 34 33 37 5C 55 30 34 34 43 20 5C 55 30 34 32 30 5C 55 30 34 33 45 5C 55 30 34 34 31 5C 55 30 34 34 31 5C 55 30 34 33 38 5C 55 30 34 33 38
The text was updated successfully, but these errors were encountered: