Character encoding issues
jeffw-wherethebitsroam opened this issue · comments
Jeff Williams commented
Hi Stephen,
I just watched your NDC video. I noticed that in your examples you convert string to bytes using:
Encoding.ASCII.GetBytes()
And then convert bytes to string again using:
Encoding.UTF8.GetString()
While this works find for the english alphabet, as soon as you throw in a few non-acsii characters (like æ,ø and å here in Norway), it will fail. You should use:
Encoding.UTF8.GetBytes()
To convert the string to bytes.
Other than that, interesting video.
Jeff
stephenhaunts commented
Thanks. Definitely a mistake. Thanks for spotting it.
Steve
On 4 October 2018 at 15:57:04, Jeff Williams (notifications@github.com<mailto:notifications@github.com>) wrote:
Hi Stephen,
I just watched your NDC video. I noticed that in your examples you convert string to bytes using:
Encoding.ASCII.GetBytes()
And then convert bytes to string again using:
Encoding.UTF8.GetString()
While this works find for the english alphabet, as soon as you throw in a few non-acsii characters (like æ,ø and å here in Norway), it will fail. You should use:
Encoding.UTF8.GetBytes()
To convert the string to bytes.
Other than that, interesting video.
Jeff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fstephenhaunts%2FAzureKeyVault%2Fissues%2F1&data=02%7C01%7C%7C608da47a82f241a2613308d62a0144fc%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636742582263748314&sdata=7HO2oERYElsjXUfYWirXVv6wKCeG9%2FCcYNSg02WrSdo%3D&reserved=0>, or mute the thread<https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHFcTPZPvxIgYHBl4CMyz_GcIQEShu2_ks5uhhOvgaJpZM4XIKvS&data=02%7C01%7C%7C608da47a82f241a2613308d62a0144fc%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636742582263748314&sdata=7u5NTYqrS%2F5j9%2FvdVhg6PHRPd9drqsSHYayeV9oK3aA%3D&reserved=0>.