diff --git a/src/ImageSharp/Formats/Jpeg/Common/Decoder/ProfileResolver.cs b/src/ImageSharp/Formats/Jpeg/Common/Decoder/ProfileResolver.cs
index 7ea0f9215e..2030ad71b1 100644
--- a/src/ImageSharp/Formats/Jpeg/Common/Decoder/ProfileResolver.cs
+++ b/src/ImageSharp/Formats/Jpeg/Common/Decoder/ProfileResolver.cs
@@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0.
using System;
+using System.Text;
namespace SixLabors.ImageSharp.Formats.Jpeg.Common.Decoder
{
@@ -13,22 +14,22 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Common.Decoder
///
/// Describes the EXIF specific markers
///
- public static readonly byte[] JFifMarker = ToAsciiBytes("JFIF\0");
+ public static readonly byte[] JFifMarker = Encoding.UTF8.GetBytes("JFIF\0");
///
/// Describes the EXIF specific markers
///
- public static readonly byte[] IccMarker = ToAsciiBytes("ICC_PROFILE\0");
+ public static readonly byte[] IccMarker = Encoding.UTF8.GetBytes("ICC_PROFILE\0");
///
/// Describes the ICC specific markers
///
- public static readonly byte[] ExifMarker = ToAsciiBytes("Exif\0\0");
+ public static readonly byte[] ExifMarker = Encoding.UTF8.GetBytes("Exif\0\0");
///
/// Describes Adobe specific markers
///
- public static readonly byte[] AdobeMarker = ToAsciiBytes("Adobe");
+ public static readonly byte[] AdobeMarker = Encoding.UTF8.GetBytes("Adobe");
///
/// Returns a value indicating whether the passed bytes are a match to the profile identifer
@@ -41,19 +42,5 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Common.Decoder
return bytesToCheck.Length >= profileIdentifier.Length
&& bytesToCheck.Slice(0, profileIdentifier.Length).SequenceEqual(profileIdentifier);
}
-
- // No Encoding.ASCII nor Linq.Select on NetStandard 1.1
- private static byte[] ToAsciiBytes(string str)
- {
- int length = str.Length;
- byte[] bytes = new byte[length];
- char[] chars = str.ToCharArray();
- for (int i = 0; i < length; i++)
- {
- bytes[i] = (byte)chars[i];
- }
-
- return bytes;
- }
}
}
\ No newline at end of file