[Cocoa-sharp] Re: Cocoa# problem with UTF-8 strings...

Urs Muff umuff@QUARK.com
Wed, 26 Jan 2005 13:31:45 -0700


I get
'Illegal instruction'
When trying to use this patch with monodoc (my only test client).

- Urs C. Muff
Software Architect       - Research Lab, Quark EIF
Quark Inc.
UMuff@Quark.Com         - X6360
+1 (303) 894 3360

CONFIDENTIALITY NOTICE
This e-mail transmission and any documents, files, or previous e-mail
messages appended or attached to it, may contain information that is
confidential or legally privileged. If you are not the intended
recipient, or a person responsible for delivering it to the intended
recipient, you are hereby notified that you must not read this
transmission and that any disclosure, copying, printing, distribution,
or use of the information contained or attached to this transmission is
STRICTLY PROHIBITED. If you have received this transmission in error,
please immediately notify the sender by telephone (+1.303.894.3360) or
return e-mail message (umuff@quark.com) and delete the original
transmission, its attachments, and any copies without reading or saving
in any manner. Thank you.

-----Original Message-----
From: cocoa-sharp-admin@lists.ximian.com
[mailto:cocoa-sharp-admin@lists.ximian.com] On Behalf Of grompf
Sent: Wednesday, January 26, 2005 12:32 PM
To: Edward J.Sabol
Cc: cocoa-sharp@lists.ximian.com
Subject: Re: [Cocoa-sharp] Re: Cocoa# problem with UTF-8 strings...

Edward,

     Please try your code against cocoa# from SVN with this patch
applied

Index: generator/custom/Foundation/TypeConverter.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- ../cocoa-sharp/generator/custom/Foundation/TypeConverter.cs =20
(revision 38922)
+++ ../cocoa-sharp/generator/custom/Foundation/TypeConverter.cs =20
(working copy)
@@ -122,7 +122,7 @@
                                 return nsObj.Raw;
                         string str =3D obj as string;
                         if (str !=3D null)
-                               return new NSString(str).Raw;
+                               return =20
((NSString)(NSString.StringWithUTF8String (str))).Raw;
                         throw new Exception("Net2NS: not handled type =20
of object: " + obj.GetType());
                 }
         }

On 26-Jan-05, at 3:12 AM, grompf wrote:


>
> On 26-Jan-05, at 2:59 AM, Edward J. Sabol wrote:
>
>
>>> I'm not sure that actually is nightly; adhamh can you confirm?
>>
>> Well, I have SVN now, so I could upgrade to the latest version if you

>> think
>> that would help.
>>
>>
>
> Yes definately run from SVN
>
>
>>> Are you even sure NSOutlineView can take UTF8 without some
custom-fu?
>>
>> I have no idea. I would hope it could, assuming the NSStrings are =20
>> initialized
>> correctly. I think the Finder use NSOutlineView for "View as List" =20
>> and file
>> names are UTF-8, right? But the Finder probably subclasses the heck =20
>> out of
>> NSOutlineView, if it uses it at all, so I don't know. Anyway, if =20
>> there's
>> another NS control/view you'd like me to test it with that you know =20
>> handles
>> UTF-8 strings, I could probably attempt to do so...
>>
>
> Ok I think I know what the problem here is; our string hiding does
> new NSString (str).Raw;
>
> which is:
>
> public NSString(string str) : =20
> this((IntPtr)ObjCMessaging.objc_msgSend=20
> (NSString_classPtr,"stringWithCString:",typeof(IntPtr),typeof=20
> (string),str),false) {}
>
> which in your case should be
> stringWithUTF8String:
>
> We'll have a chat about this (me and urs) tomorrow and think about how

> to handle
>
> -kangaroo
>
> _______________________________________________
> Cocoa-sharp mailing list
> Cocoa-sharp@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/cocoa-sharp
>
>
> !DSPAM:41f74f7a287291865249173!
>


_______________________________________________
Cocoa-sharp mailing list
Cocoa-sharp@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/cocoa-sharp