From 4eb84939ca1987b3ce0ffb644bcdee60a6285400 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Tue, 17 Dec 2019 09:11:06 -0600 Subject: [PATCH] Fix String Length for UTF8 Encoding --- Droid/Properties/AndroidManifest.xml | 2 +- iOS/Info.plist | 2 +- iOS/qController.iOS.csproj | 3 ++- .../Classes/Communication/SharpOSC/OscPacket.cs | 7 +++---- 4 files changed, 7 insertions(+), 7 deletions(-) mode change 100755 => 100644 qController.Standard/Classes/Communication/SharpOSC/OscPacket.cs diff --git a/Droid/Properties/AndroidManifest.xml b/Droid/Properties/AndroidManifest.xml index 9eab380..fdd5f3b 100644 --- a/Droid/Properties/AndroidManifest.xml +++ b/Droid/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/iOS/Info.plist b/iOS/Info.plist index d2bf6e2..ace49e0 100644 --- a/iOS/Info.plist +++ b/iOS/Info.plist @@ -36,7 +36,7 @@ XSAppIconAssets Assets.xcassets/AppIcon.appiconset CFBundleShortVersionString - 2.1.0 + 2.1.2 CFBundleVersion 1.0 ITSAppUsesNonExemptEncryption diff --git a/iOS/qController.iOS.csproj b/iOS/qController.iOS.csproj index ecd80d3..fa259ad 100644 --- a/iOS/qController.iOS.csproj +++ b/iOS/qController.iOS.csproj @@ -37,13 +37,14 @@ bin\iPhone\Release prompt 4 - iPhone Developer + iPhone Developer: Joel Wetzell (5E8CU66YWB) true Entitlements.plist SdkOnly ARMv7, ARM64 HttpClientHandler x86 + qController Dev pdbonly diff --git a/qController.Standard/Classes/Communication/SharpOSC/OscPacket.cs b/qController.Standard/Classes/Communication/SharpOSC/OscPacket.cs old mode 100755 new mode 100644 index 8ee9798..0c29af0 --- a/qController.Standard/Classes/Communication/SharpOSC/OscPacket.cs +++ b/qController.Standard/Classes/Communication/SharpOSC/OscPacket.cs @@ -391,12 +391,11 @@ namespace SharpOSC protected static byte[] setString(string value) { - int len = value.Length + (4 - value.Length % 4); - if (len <= value.Length) len = len + 4; + var bytes = Encoding.UTF8.GetBytes(value); + int len = bytes.Length + (4 - bytes.Length % 4); + if (len <= bytes.Length) len = len + 4; byte[] msg = new byte[len]; - - var bytes = Encoding.UTF8.GetBytes(value); bytes.CopyTo(msg, 0); return msg;