Browse Source

Make sure we're using the ANSI Charset for IP and Hostnames. We should not be using Unicode for server hostnames or IPs.

Matt Coburn 6 years ago
parent
commit
97e26fe38b
1 changed files with 4 additions and 4 deletions
  1. 4 4
      Source/Managed/ENet.cs

+ 4 - 4
Source/Managed/ENet.cs

@@ -1024,16 +1024,16 @@ namespace ENet
         [DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
         internal static extern uint enet_time_get();
 
-        [DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
         internal static extern int enet_address_set_host_ip(ref ENetAddress address, string ip);
 
-        [DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
         internal static extern int enet_address_set_host(ref ENetAddress address, string hostName);
 
-        [DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
         internal static extern int enet_address_get_host_ip(ENetAddress address, StringBuilder ip, IntPtr ipLength);
 
-        [DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
         internal static extern int enet_address_get_host(ENetAddress address, StringBuilder hostName, IntPtr nameLength);
 
         [DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]