From c58d1f22613f43ae0e879ab592da9bd13a26fc13 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Fri, 29 Sep 2023 18:27:27 +0100 Subject: [PATCH] Use UTF-8 string literals whenever possible. --- SCSI/EVPD.cs | 4 ++-- SCSI/Inquiry.cs | 5 +---- SCSI/Modes/30_Apple.cs | 6 +----- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/SCSI/EVPD.cs b/SCSI/EVPD.cs index cc12b55..190d9ef 100644 --- a/SCSI/EVPD.cs +++ b/SCSI/EVPD.cs @@ -2176,7 +2176,7 @@ public static class EVPD decoded.Copyright = Encoding.ASCII.GetBytes(str); else if(fwMatch.Success) { - decoded.Component = Encoding.ASCII.GetBytes("Firmware"); + decoded.Component = "Firmware"u8.ToArray(); decoded.Version = Encoding.ASCII.GetBytes(fwMatch.Groups["fw"].Value); decoded.Date = Encoding.ASCII.GetBytes(fwMatch.Groups["date"].Value); } @@ -2184,7 +2184,7 @@ public static class EVPD decoded.Variant = Encoding.ASCII.GetBytes(fwMatch.Groups["value"].Value); else if(servoMatch.Success) { - decoded.Component = Encoding.ASCII.GetBytes("Servo"); + decoded.Component = "Servo"u8.ToArray(); decoded.Version = Encoding.ASCII.GetBytes(servoMatch.Groups["version"].Value); } diff --git a/SCSI/Inquiry.cs b/SCSI/Inquiry.cs index a3c882d..697d43c 100644 --- a/SCSI/Inquiry.cs +++ b/SCSI/Inquiry.cs @@ -2400,10 +2400,7 @@ public static class Inquiry if(response.HP_WORM) sb.AppendFormat(Localization.Device_supports_WORM_version_0, response.HP_WORMVersion).AppendLine(); - byte[] OBDRSign = - { - 0x24, 0x44, 0x52, 0x2D, 0x31, 0x30 - }; + byte[] OBDRSign = "$DR-10"u8.ToArray(); if(OBDRSign.SequenceEqual(response.HP_OBDR)) sb.AppendLine(Localization.Device_supports_Tape_Disaster_Recovery); diff --git a/SCSI/Modes/30_Apple.cs b/SCSI/Modes/30_Apple.cs index 3af4b84..e1aaab0 100644 --- a/SCSI/Modes/30_Apple.cs +++ b/SCSI/Modes/30_Apple.cs @@ -41,11 +41,7 @@ namespace Aaru.Decoders.SCSI; public static partial class Modes { #region Apple Mode Page 0x30: Apple OEM String - static readonly byte[] AppleOEMString = - { - 0x41, 0x50, 0x50, 0x4C, 0x45, 0x20, 0x43, 0x4F, 0x4D, 0x50, 0x55, 0x54, 0x45, 0x52, 0x2C, 0x20, 0x49, 0x4E, - 0x43, 0x2E - }; + static readonly byte[] AppleOEMString = "APPLE COMPUTER, INC."u8.ToArray(); public static bool IsAppleModePage_30(byte[] pageResponse) {