Skip to content

Commit 75e0db1

Browse files
committed
Updated compiler constants for NET40 (and greater)
1 parent 80985a0 commit 75e0db1

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

QRCoder/PayloadGenerator.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2494,11 +2494,10 @@ public override string ToString()
24942494
var cp = characterSet.ToString().Replace("_", "-");
24952495
var bytes = ToBytes();
24962496

2497-
#if !NET35 && !NET40 && !NETSTANDARD1_3_OR_GREATER
2497+
#if !NET35_OR_GREATER && !NETSTANDARD1_3_OR_GREATER
24982498
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
24992499
#endif
2500-
#if NETSTANDARD1_3
2501-
// TODO: Fix for NETSTANDARD1.1
2500+
#if NETSTANDARD1_3
25022501
return Encoding.GetEncoding(cp).GetString(bytes,0,bytes.Length);
25032502
#else
25042503
return Encoding.GetEncoding(cp).GetString(bytes);
@@ -3089,11 +3088,7 @@ private static string ConvertStringToEncoding(string message, string encoding)
30893088
Encoding utf8 = Encoding.UTF8;
30903089
byte[] utfBytes = utf8.GetBytes(message);
30913090
byte[] isoBytes = Encoding.Convert(utf8, iso, utfBytes);
3092-
#if NET40
3093-
return iso.GetString(isoBytes);
3094-
#else
3095-
return iso.GetString(isoBytes,0, isoBytes.Length);
3096-
#endif
3091+
return iso.GetString(isoBytes, 0, isoBytes.Length);
30973092
}
30983093

30993094
private static string EscapeInput(string inp, bool simple = false)

0 commit comments

Comments
 (0)