Unexpected results when using strings with encoding functions
27 Sep
2011
27 Sep
'11
7:09 p.m.
Hi, I've just spent a long time being puzzled by the following behavior. I have a String (I thought). When I tried to use my_string.encode(..) I got a NoMethodError exception. I only finally realised what was happening when I subsequently did my_string.force_encoding(...). In this case I get a helpful exception telling me that force_encoding is not supported for NSStrings. It would be very helpful if encode failed in the same way - or even created a ruby String under the covers? Steve
5156
Age (days ago)
5156
Last active (days ago)
0 comments
1 participants
participants (1)
-
Steve Clarke