R
R
rozochkin2014-07-12 00:35:54
iOS
rozochkin, 2014-07-12 00:35:54

How to fix encoding to UTF8 in iOS?

I get id3 tag from mp3 in iOS application from a song with a Russian name.
I use:

AVMetadataItem *item = [self.player.metaData objectAtIndex:0];
self.nameSong.text = item.stringValue;
NSLog("%@");

I get:
ÐÐРЯЧÐÐ+ШÐÐÐÐÐÐ+СТÐÐЫ+//+СÐУШÐЮТ:+1655
There are no problems with English.
How to solve the problem with Russian titles?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iA_R_T, 2014-07-24
@iA_R_T

Maybe not relevant anymore, but I found a solution, I hope someone will find it useful
const char *charValue = [item.stringValue cStringUsingEncoding:NSISOLatin1StringEncoding];
NSString *returnStr = [[NSString alloc]initWithCString:charValue encoding:NSUTF8StringEncoding];
encoding iso-8859-1 to UTF8, objective-c, ios

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question