1- #if NET45_OR_GREATER || NETSTANDARD || NETCOREAPP2_1
1+ #if NET45_OR_GREATER || NETSTANDARD
22using System . Buffers ;
33#endif
44using System . Text ;
@@ -38,7 +38,7 @@ public static string UnicodeToAnsi(string value, out int byteCount)
3838
3939 try
4040 {
41- #if NET45_OR_GREATER || NETSTANDARD || NETCOREAPP2_1
41+ #if NET45_OR_GREATER || NETSTANDARD
4242 result = ConvertStringInternal ( utf8Encoding , ansiEncoding , value , valueLength , buffer , bufferLength ) ;
4343#else
4444 utf8Encoding . GetBytes ( value , 0 , valueLength , buffer , 0 ) ;
@@ -54,7 +54,7 @@ public static string UnicodeToAnsi(string value, out int byteCount)
5454
5555 return result ;
5656 }
57- #if NET45_OR_GREATER || NETSTANDARD || NETCOREAPP2_1
57+ #if NET45_OR_GREATER || NETSTANDARD
5858
5959 private static unsafe string ConvertStringInternal ( Encoding srcEncoding , Encoding dstEncoding , string s ,
6060 int charCount , byte [ ] bytes , int byteCount )
@@ -63,7 +63,7 @@ private static unsafe string ConvertStringInternal(Encoding srcEncoding, Encodin
6363 fixed ( byte * pBytes = bytes )
6464 {
6565 srcEncoding . GetBytes ( pString , charCount , pBytes , byteCount ) ;
66- #if NET471 || NETSTANDARD || NETCOREAPP2_1
66+ #if NET471 || NETSTANDARD
6767 string result = dstEncoding . GetString ( pBytes , byteCount ) ;
6868
6969 return result ;
0 commit comments