Fix String Length for UTF8 Encoding

This commit is contained in:
2019-12-17 09:11:06 -06:00
parent 0c1c99fdfc
commit 4eb84939ca
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="28" android:versionName="1.1.1" package="com.jwetzell.qlabcontroller" android:installLocation="auto"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="29" android:versionName="1.1.2" package="com.jwetzell.qlabcontroller" android:installLocation="auto">
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="28" /> <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="28" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+1 -1
View File
@@ -36,7 +36,7 @@
<key>XSAppIconAssets</key> <key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string> <string>Assets.xcassets/AppIcon.appiconset</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.1.0</string> <string>2.1.2</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
+2 -1
View File
@@ -37,13 +37,14 @@
<OutputPath>bin\iPhone\Release</OutputPath> <OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey> <CodesignKey>iPhone Developer: Joel Wetzell (5E8CU66YWB)</CodesignKey>
<MtouchFloat32>true</MtouchFloat32> <MtouchFloat32>true</MtouchFloat32>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements> <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchLink>SdkOnly</MtouchLink> <MtouchLink>SdkOnly</MtouchLink>
<MtouchArch>ARMv7, ARM64</MtouchArch> <MtouchArch>ARMv7, ARM64</MtouchArch>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler> <MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
<CodesignProvision>qController Dev</CodesignProvision>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
+3 -4
View File
@@ -391,12 +391,11 @@ namespace SharpOSC
protected static byte[] setString(string value) protected static byte[] setString(string value)
{ {
int len = value.Length + (4 - value.Length % 4); var bytes = Encoding.UTF8.GetBytes(value);
if (len <= value.Length) len = len + 4; int len = bytes.Length + (4 - bytes.Length % 4);
if (len <= bytes.Length) len = len + 4;
byte[] msg = new byte[len]; byte[] msg = new byte[len];
var bytes = Encoding.UTF8.GetBytes(value);
bytes.CopyTo(msg, 0); bytes.CopyTo(msg, 0);
return msg; return msg;