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"?>
<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-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+1 -1
View File
@@ -36,7 +36,7 @@
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<key>CFBundleShortVersionString</key>
<string>2.1.0</string>
<string>2.1.2</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>ITSAppUsesNonExemptEncryption</key>
+2 -1
View File
@@ -37,13 +37,14 @@
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<CodesignKey>iPhone Developer: Joel Wetzell (5E8CU66YWB)</CodesignKey>
<MtouchFloat32>true</MtouchFloat32>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchLink>SdkOnly</MtouchLink>
<MtouchArch>ARMv7, ARM64</MtouchArch>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
<PlatformTarget>x86</PlatformTarget>
<CodesignProvision>qController Dev</CodesignProvision>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>pdbonly</DebugType>
+3 -4
View File
@@ -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;