Develop and Download Open Source Software

[Rubycocoa-devel 1230] Re: byte string conversion

Satoshi Nakagawa snakagawa at infoteria.co.jp
Wed Nov 7 01:08:32 JST 2007


Hi,

On 2007/11/06, at 22:35, kimura wataru wrote:

>> I think we can assume $KCODE = 'utf8' at least on OS X.
>> So I suggest that we should make NSString.guess_*encoding methods
>> deprecated.
>>
>
> I've deprecated these methods and tests at r2105. Whoever can
> revert this change.  I'll deprecate *WithRubyString methods in
> osx/objc/cocoa_macros.rb.

Cool.
I agree also about *WithRubyString methods.

> I'm looking for how to know encoding failure.

In reference to the document:

http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#/ 
/apple_ref/occ/instm/NSString/initWithData:encoding:

> Returns nil if the initialization fails for some reason (for example  
> if data does not represent valid data for encoding).

So we can decide the conversion is succeeded or not from the return  
value.

--
Satoshi Nakagawa




More information about the Rubycocoa-devel mailing list

SourceForge.JP is a Japanese version of SourceForge.net. For developments that are not related to Japan, we recommend you to use SourceForge.net.