Giter Site home page Giter Site logo

fumoboy007 / universalcharsetdetection Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 4.0 248 KB

A Swift wrapper around the `uchardet` library to detect the character encoding of a sequence of bytes.

License: Other

Swift 3.06% C++ 77.09% C 19.65% Shell 0.20%
swift swift4-2 swift5 uchardet charset-detector charset-detection character-encoding

universalcharsetdetection's Introduction

UniversalCharsetDetection

A Swift wrapper around the uchardet library to detect the character encoding of a sequence of bytes.

uchardet is more versatile than NSString.stringEncoding(for:encodingOptions:convertedString:usedLossyConversion:) because

  • it supports many more encodings;
  • it supports streaming large files; and
  • its output is compatible with iconv.

Usage

Compatible with Swift 4.2+.

  • To integrate the library into your project, add a dependency on this package in your project’s Swift Package Manager configuration file or in your Xcode 11+ project.
  • To detect the character encoding of a file, see CharacterEncodingDetector+File.
  • To detect the character encoding of a collection of bytes, see DataProtocol+CharacterEncoding.
  • To detect the character encoding of a manually-provided stream of bytes, see CharacterEncodingDetector.

License

See the LICENSE.md file.

Contributing

Since the Swift Package Manager does not yet support binary dependencies, we copy the uchardet source code into the Sources/Cuchardet directory to enable the Swift Package Manager to build and link with the uchardet library. See the adapt-uchardet-to-swiftpm script.

To change the version of the uchardet library, run the following commands in the root of the source code directory tree:

$ git init uchardet
$ git submodule update --remote uchardet
$ cd uchardet
$ git checkout <master or tag name>
$ cd ..
$ ./adapt-uchardet-to-swiftpm

universalcharsetdetection's People

Contributors

fumoboy007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.