aboutsummaryrefslogtreecommitdiffstats
path: root/src/bindings
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-02-25 19:23:04 -0300
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-02-25 19:29:19 -0300
commit27c848c35a0fbe2efa9f83e057313a74327b2047 (patch)
treea103f1dc4a3d22fd98f27fa86e619f181dc6a3ec /src/bindings
parentefl-csharp: Remove legacy Evas bindings. (diff)
downloadefl-27c848c35a0fbe2efa9f83e057313a74327b2047.tar.gz
efl-csharp: Use proper conversion functions.
Summary: PtrToStringAuto may switch between ANSI and UTF16 encodings in a not so clear way, leading to decoding errors when getting messages from DBus. Reviewers: vitor.sousa Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8023
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_connection.cs2
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_message.cs34
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_object.cs4
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_pending.cs8
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_proxy.cs2
5 files changed, 25 insertions, 25 deletions
diff --git a/src/bindings/mono/eldbus_mono/eldbus_connection.cs b/src/bindings/mono/eldbus_mono/eldbus_connection.cs
index 099582ede5..bef7f29acb 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_connection.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_connection.cs
@@ -205,7 +205,7 @@ public class Connection : IDisposable
var ptr = eldbus_connection_unique_name_get(Handle);
if (ptr == IntPtr.Zero)
return null;
- return Marshal.PtrToStringAuto(ptr);
+ return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
public eldbus.Pending NameRequest(string bus, uint flags, eldbus.MessageDelegate dlgt = null)
diff --git a/src/bindings/mono/eldbus_mono/eldbus_message.cs b/src/bindings/mono/eldbus_mono/eldbus_message.cs
index b3826d6e13..a8c96ffe7a 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_message.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_message.cs
@@ -279,42 +279,42 @@ public class Message : IDisposable
{
CheckHandle();
var ptr = eldbus_message_path_get(Handle);
- return Marshal.PtrToStringAuto(ptr);
+ return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
public string GetInterface()
{
CheckHandle();
var ptr = eldbus_message_interface_get(Handle);
- return Marshal.PtrToStringAuto(ptr);
+ return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
public string GetMember()
{
CheckHandle();
var ptr = eldbus_message_member_get(Handle);
- return Marshal.PtrToStringAuto(ptr);
+ return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
public string GetDestination()
{
CheckHandle();
var ptr = eldbus_message_destination_get(Handle);
- return Marshal.PtrToStringAuto(ptr);
+ return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
public string GetSender()
{
CheckHandle();
var ptr = eldbus_message_sender_get(Handle);
- return Marshal.PtrToStringAuto(ptr);
+ return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
public string GetSignature()
{
CheckHandle();
var ptr = eldbus_message_signature_get(Handle);
- return Marshal.PtrToStringAuto(ptr);
+ return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
public eldbus.Message NewError(string error_name, string error_msg)
@@ -341,8 +341,8 @@ public class Message : IDisposable
IntPtr name_ptr;
IntPtr text_ptr;
bool r = eldbus_message_error_get(Handle, out name_ptr, out text_ptr);
- name = Marshal.PtrToStringAuto(name_ptr);
- text = Marshal.PtrToStringAuto(text_ptr);
+ name = Eina.StringConversion.NativeUtf8ToManagedString(name_ptr);
+ text = Eina.StringConversion.NativeUtf8ToManagedString(text_ptr);
return r;
}
@@ -408,7 +408,7 @@ public class Message : IDisposable
CheckHandle();
IntPtr aux;
var r = eldbus_message_arguments_get(Handle, Argument.StringType.Signature, out aux);
- val = Marshal.PtrToStringAuto(aux);
+ val = Eina.StringConversion.NativeUtf8ToManagedString(aux);
return r;
}
@@ -417,7 +417,7 @@ public class Message : IDisposable
CheckHandle();
IntPtr aux;
var r = eldbus_message_arguments_get(Handle, Argument.ObjectPathType.Signature, out aux);
- val = Marshal.PtrToStringAuto(aux);
+ val = Eina.StringConversion.NativeUtf8ToManagedString(aux);
return r;
}
@@ -426,7 +426,7 @@ public class Message : IDisposable
CheckHandle();
IntPtr aux;
var r = eldbus_message_arguments_get(Handle, Argument.SignatureType.Signature, out aux);
- val = Marshal.PtrToStringAuto(aux);
+ val = Eina.StringConversion.NativeUtf8ToManagedString(aux);
return r;
}
@@ -617,7 +617,7 @@ public class MessageIterator
CheckHandle();
IntPtr aux;
bool r = eldbus_message_iter_get_and_next(Handle, Argument.StringType.Code, out aux);
- val = Marshal.PtrToStringAuto(aux);
+ val = Eina.StringConversion.NativeUtf8ToManagedString(aux);
return r;
}
@@ -626,7 +626,7 @@ public class MessageIterator
CheckHandle();
IntPtr aux;
bool r = eldbus_message_iter_get_and_next(Handle, Argument.ObjectPathType.Code, out aux);
- val = Marshal.PtrToStringAuto(aux);
+ val = Eina.StringConversion.NativeUtf8ToManagedString(aux);
return r;
}
@@ -635,7 +635,7 @@ public class MessageIterator
CheckHandle();
IntPtr aux;
bool r = eldbus_message_iter_get_and_next(Handle, Argument.SignatureType.Code, out aux);
- val = Marshal.PtrToStringAuto(aux);
+ val = Eina.StringConversion.NativeUtf8ToManagedString(aux);
return r;
}
@@ -732,7 +732,7 @@ public class MessageIterator
CheckHandle();
IntPtr aux;
eldbus_message_iter_basic_get(Handle, out aux);
- val = Marshal.PtrToStringAuto(aux);
+ val = Eina.StringConversion.NativeUtf8ToManagedString(aux);
}
public void Get(out eldbus.ObjectPath val)
@@ -740,7 +740,7 @@ public class MessageIterator
CheckHandle();
IntPtr aux;
eldbus_message_iter_basic_get(Handle, out aux);
- val = Marshal.PtrToStringAuto(aux);
+ val = Eina.StringConversion.NativeUtf8ToManagedString(aux);
}
public void Get(out eldbus.SignatureString val)
@@ -748,7 +748,7 @@ public class MessageIterator
CheckHandle();
IntPtr aux;
eldbus_message_iter_basic_get(Handle, out aux);
- val = Marshal.PtrToStringAuto(aux);
+ val = Eina.StringConversion.NativeUtf8ToManagedString(aux);
}
public void Get(out eldbus.UnixFd val)
diff --git a/src/bindings/mono/eldbus_mono/eldbus_object.cs b/src/bindings/mono/eldbus_mono/eldbus_object.cs
index 44888532ef..7b48743dd3 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_object.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_object.cs
@@ -175,14 +175,14 @@ public class Object : System.IDisposable
{
CheckHandle();
var ptr = eldbus_object_bus_name_get(Handle);
- return Marshal.PtrToStringAuto(ptr);
+ return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
public string GetPath()
{
CheckHandle();
var ptr = eldbus_object_path_get(Handle);
- return Marshal.PtrToStringAuto(ptr);
+ return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
public void Ref()
diff --git a/src/bindings/mono/eldbus_mono/eldbus_pending.cs b/src/bindings/mono/eldbus_mono/eldbus_pending.cs
index f5afa05700..906630ecbb 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_pending.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_pending.cs
@@ -82,28 +82,28 @@ public class Pending
{
CheckHandle();
var ptr = eldbus_pending_destination_get(Handle);
- return Marshal.PtrToStringAuto(ptr);
+ return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
public string GetPath()
{
CheckHandle();
var ptr = eldbus_pending_path_get(Handle);
- return Marshal.PtrToStringAuto(ptr);
+ return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
public string GetInterface()
{
CheckHandle();
var ptr = eldbus_pending_interface_get(Handle);
- return Marshal.PtrToStringAuto(ptr);
+ return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
public string GetMethod()
{
CheckHandle();
var ptr = eldbus_pending_method_get(Handle);
- return Marshal.PtrToStringAuto(ptr);
+ return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
}
diff --git a/src/bindings/mono/eldbus_mono/eldbus_proxy.cs b/src/bindings/mono/eldbus_mono/eldbus_proxy.cs
index fa34ce307b..ea44ca5db5 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_proxy.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_proxy.cs
@@ -141,7 +141,7 @@ public class Proxy : IDisposable
{
CheckHandle();
var ptr = eldbus_proxy_interface_get(Handle);
- return Marshal.PtrToStringAuto(ptr);
+ return Eina.StringConversion.NativeUtf8ToManagedString(ptr);
}
eldbus.Message NewMethodCall(string member)