From f22bc68d948531b90a7e9ce9dc6f93e021007836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Fri, 20 May 2016 21:19:09 +0200 Subject: [PATCH] Count the string length in the system codepage. --- OpenRA.Platforms.Default/OpenAlSoundEngine.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenRA.Platforms.Default/OpenAlSoundEngine.cs b/OpenRA.Platforms.Default/OpenAlSoundEngine.cs index 56d0e8faf1..5f76074ea7 100644 --- a/OpenRA.Platforms.Default/OpenAlSoundEngine.cs +++ b/OpenRA.Platforms.Default/OpenAlSoundEngine.cs @@ -13,6 +13,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; +using System.Text; using OpenAL; namespace OpenRA.Platforms.Default @@ -65,7 +66,7 @@ namespace OpenRA.Platforms.Default do { var str = Marshal.PtrToStringAuto(next); - next += str.Length + 1; + next += UnicodeEncoding.Default.GetByteCount(str) + 1; devices.Add(str); } while (Marshal.ReadByte(next) != 0);