siuying / UniversalDetector

Wrapper of uchardet for Objective-C. UniversalDetector takes a sequence of bytes in an unknown character encoding without any additional information, and attempts to determine the encoding of the text.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UniversalDetector for Objective-C

UniversalDetector is a wrapper for uchardet, which is based on C++ implementation of the universal charset detection library by Mozilla.

UniversalDetector 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.

Usage

CFStringEncoding encoding = [UniversalDetector encodingWithData:data];
NSString* encodingStr      = [UniversalDetector encodingAsStringWithData:data];

Installation

If you use CocoaPods, add following line to your Podfile:

pod 'UniversalDetector'

Otherwise, add 'UniversalDetector/.{h,m}', 'external/.{h,cpp}', 'external/universalchardet/src/base/*.{cpp,h,tab}' and library 'libstdc++' to your project.

LICENSE

Mozilla Public License, refer to file LICENSE.

About

Wrapper of uchardet for Objective-C. UniversalDetector takes a sequence of bytes in an unknown character encoding without any additional information, and attempts to determine the encoding of the text.

License:Mozilla Public License 2.0


Languages

Language:HTML 97.0%Language:Objective-C 2.6%Language:Ruby 0.4%