[mani2/cocoa] * use initWithBytes and autorelease instead of stringWithCString because of deprecated
@@ -157,8 +157,9 @@ | ||
157 | 157 | unsigned short stringLength = [self readUShort]; |
158 | 158 | if (stringLength == 0 || position + stringLength > length) |
159 | 159 | return @""; |
160 | - NSString *newString = [NSString stringWithCString:(const char *)(bytes + position) | |
161 | - length:stringLength]; | |
160 | + NSString *newString = [[[NSString alloc] initWithBytes:(const char *)(bytes + position) | |
161 | + length:stringLength | |
162 | + encoding:NSUTF8StringEncoding] autorelease]; | |
162 | 163 | position += stringLength; |
163 | 164 | return newString; |
164 | 165 | } |