Skip to content

Commit 18c30c3

Browse files
authored
fix bug
fix:using utf8 encoding get strings instead of default coding
1 parent 4bf4af1 commit 18c30c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdk/Aliyun/OTS/ProtoBuffer/SearchVariantType.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ public static byte[] FromString(string v)
7575
{
7676
using (MemoryStream ms = new MemoryStream())
7777
{
78-
byte[] strBytes = UTF8Encoding.Default.GetBytes(v);
78+
byte[] strBytes = Encoding.UTF8.GetBytes(v);
7979

8080
ms.WriteByte(VT_STRING);
8181
foreach (var item in BitConverter.GetBytes(strBytes.Length))
8282
{
8383
ms.WriteByte(item);
8484
}
8585

86-
foreach (var item in UTF8Encoding.Default.GetBytes(v))
86+
foreach (var item in Encoding.UTF8.GetBytes(v))
8787
{
8888
ms.WriteByte(item);
8989
}

0 commit comments

Comments
 (0)