[Openmcl-devel] Objective-C string to lisp string?
Paul Krueger
plkrueger at comcast.net
Wed Apr 6 08:47:19 PDT 2011
Answered my own question: operator error. ccl::lisp-string-from-nsstring works fine for all NSStrings. The ccl::@ macro creates an NSConstantString which by definition is a subclass of NSSimpleCString (i.e. not an encoded string). So if you want an NSString with UTF8 characters you can use something like:
? (objc:make-nsstring "été")
#<NS-MUTABLE-STRING "été" (#x16038F80)>
? (ccl::lisp-string-from-nsstring *)
"été"
?
Paul
On Apr 6, 2011, at 9:18 AM, Paul Krueger wrote:
> On my system:
>
> ? (ccl::lisp-string-from-nsstring #@"été")
> "ÈtÈ"
> ?
>
> Is that a bug somewhere or explained by Gary's previous email? Still confused ...
>
> Paul
>
> On Apr 6, 2011, at 7:33 AM, Gary Byers wrote:
>
>>
>> On Wed, 6 Apr 2011, Raffael Cavallaro wrote:
>>
>>>
>>> On Apr 5, 2011, at 11:01 PM, Pascal J. Bourguignon wrote:
>>>
>>>> How can I get back a lisp string from an Objective-C string, for example
>>>> obtained from [field stringValue]?
>>>
>>> ccl::lisp-string-from-nsstring
>>
>> AKA objc:lisp-string-from-nsstring
>>
>>
>>>
>>> warmest regards,
>>>
>>> Ralph
>>>
>>>
>>> Raffael Cavallaro
>>> raffaelcavallaro at me.com
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Openmcl-devel mailing list
>>> Openmcl-devel at clozure.com
>>> http://clozure.com/mailman/listinfo/openmcl-devel
>>>
>>>
>> _______________________________________________
>> Openmcl-devel mailing list
>> Openmcl-devel at clozure.com
>> http://clozure.com/mailman/listinfo/openmcl-devel
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
More information about the Openmcl-devel
mailing list