UniversalDetector2 is a wrapper for uchardet, which is based on C++ implementation of the universal charset detection library by Mozilla.
UniversalDetector2 is an encoding detector library, which takes a sequence of bytes in an unknown character encoding without any additional information, and attempts to determine the encoding of the text.
UniversalDetector2 is a drop-in replacement for UniversalDetector with an updated version of the underlying uchardet library.
CFStringEncoding encoding = [UniversalDetector encodingWithData:data];
NSString* encodingStr = [UniversalDetector encodingAsStringWithData:data];
If you use CocoaPods, add following line to your Podfile:
pod 'UniversalDetector2'
Otherwise, add 'UniversalDetector/.{h,m}', 'external/.{h,cpp}', 'external/universalchardet/src/base/*.{cpp,h,tab}' and library 'libstdc++' to your project.
Mozilla Public License, refer to file LICENSE.