getBytes() in Java returns different byte array than getBytes () to c #

0
=
0
+
0
No specific Bitcoin Bounty has been announced by author. Still, anyone could send Bitcoin Tips to those who provide a good answer.
0

Hi everyone.

I runs this Java code:

String s = "73b53b86-eee3-44d2-82e3-be94d93deb5b";
byte[] result = s.getBytes(Charset.forName("UTF-8"));

Length of the result var: 23

And runs this C# code:

string s = "73b53b86-eee3-44d2-82e3-be94d93deb5b";
byte[] result = Encoding.UTF8.GetBytes(s);

Length of the result var: 36

I can not understand what the problem is. Thanks

0 answers

0
=
0
=
$0
Internet users could send Bitcoin Tips to you if they like your answer!

Too many commands? Learning new syntax?

FavScripts.com is a free tool to save your favorite scripts and commands, then quickly find and copy-paste your commands with just few clicks.

Boost your productivity with FavScripts.com!

Post Answer