Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

UTF8-String to ASCII (Decode and Encode)

Hi everyone, I have some stein like that
password(“password goes here”);
And I need to encrypt this string to ASCII like that
var encode(function)
password(decode((“ascii goes here)));
Thanks everyone to answers
As I'm sure you're aware, the default string reference type consists of UTF-16 encoded data and not UTF-8. This is true for both the .NET Framework and .NET Core. For more information, please visit the official documentation here:
https://docs.microsoft.com/en-us/dotnet/...mework-4.8

In order to retrieve ASCII encoded data from a string in C#, one can utilize:
Code
Encoding.ASCII.GetBytes(value);

For more information, please visit the official documentation here:
https://docs.microsoft.com/en-us/dotnet/...mework-4.8
[Image: vp6iypF.gif]
(Jan 26, 2020 08:54 AM)MavenGradle Wrote:  As I'm sure you're aware, the default string reference type consists of UTF-16 encoded data and not UTF-8. This is true for both the .NET Framework and .NET Core. For more information, please visit the official documentation here:
https://docs.microsoft.com/en-us/dotnet/...mework-4.8

In order to retrieve ASCII encoded data from a string in C#, one can utilize:
Code
Encoding.ASCII.GetBytes(value);

For more information, please visit the official documentation here:
https://docs.microsoft.com/en-us/dotnet/...mework-4.8
Thank you so much


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by mayar2020Apr 13, 2020 08:52 PM 9 244 Apr 13, 2020 08:52 PM
Last Post: zataeta
[C] by MordiciaNov 15, 2019 07:21 PM 3 210 Nov 15, 2019 07:21 PM
Last Post: Mordicia
[Java] by ComputroniumMar 3, 2018 11:38 AM 2 229 Mar 3, 2018 11:38 AM
Last Post: Computronium