[Mono-bugs] [Bug 565703] UITextField.get_Text has problems with encoding

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Dec 27 17:05:40 EST 2009


http://bugzilla.novell.com/show_bug.cgi?id=565703

http://bugzilla.novell.com/show_bug.cgi?id=565703#c2


--- Comment #2 from Ed Anuff <ed at anuff.com> 2009-12-27 22:05:31 UTC ---
I believe this is actually a problem with NSString.  The following code
bypasses the class library binding and forces Unicode encoding of the data, and
still results in the ???? string:

public static string GetText(UITextField ob) {
    NSString nsstr = new NSString(Messaging.IntPtr_objc_msgSend(ob.Handle, new
Selector("text").Handle));
    NSData nsdata = new NSData(Messaging.IntPtr_objc_msgSend_int(nsstr.Handle,
new Selector("dataUsingEncoding:").Handle, 10));
    return NSString.FromData(nsdata, NSStringEncoding.Unicode).ToString();
}

Changing the above code to force Unicode rather than UTF8 results in the same
thing.  If I had to guess, it's happening in the NSString.ToString() method.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list