charsetdetect-ae 1.0.1 → 1.1
raw patch · 3 files changed
+19/−15 lines, 3 filesnew-uploaderPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Codec/Text/Detect.hs +5/−5
- charsetdetect-ae.cabal +13/−9
- libcharsetdetect/nspr-emu/prcpucfg_win.h +1/−1
Codec/Text/Detect.hs view
@@ -7,6 +7,7 @@ import qualified Data.ByteString.Internal as SI import qualified Data.ByteString.Lazy as L import Data.Traversable (traverse)+import Control.Applicative import Foreign.C.Types import Foreign.C.String@@ -42,7 +43,6 @@ -- > Big5 -- > EUC-JP -- > EUC-KR--- > GB18030 -- > gb18030 -- > HZ-GB-2312 -- > IBM855@@ -71,9 +71,6 @@ -- > X-ISO-10646-UCS-4-2143 -- > X-ISO-10646-UCS-4-3412 -- > x-mac-cyrillic------ Note that there are two capitalisations of @gb18030@. For this reason (and to be future-proof against any future behaviour--- like this for newly-added character sets) we recommend that you compare character set names case insensitively. {-# NOINLINE detectEncodingName #-} detectEncodingName :: L.ByteString -> Maybe String detectEncodingName b = unsafePerformIO $ do@@ -90,7 +87,10 @@ c_encoding_ptr <- c_csd_close csd if c_encoding_ptr == nullPtr then return Nothing- else fmap Just (peekCString c_encoding_ptr)+ else Just . normalise <$> peekCString c_encoding_ptr+ where+ normalise "GB18030" = "gb18030"+ normalise x = x -- | Detect the encoding for a 'L.ByteString' and attempt to create a 'TextEncoding' suitable for decoding it. detectEncoding :: L.ByteString -> IO (Maybe TextEncoding)
charsetdetect-ae.cabal view
@@ -1,19 +1,23 @@ Name: charsetdetect-ae-Version: 1.0.1+Version: 1.1 Cabal-Version: >= 1.6 Category: Text Synopsis: Character set detection using Mozilla's Universal Character Set Detector-Description: Mozilla have developed a robust and efficient character set detection algorithm for- use in their web browsers. The algorithm is able to detect all of the most frequently- encountered character encodings totally automatically.- .- This library wraps up their library and exposes a very simple Haskell interface to it.- The library is portable, and is confirmed to work on both Unix and Windows.+Description:+ Mozilla have developed a robust and efficient character set detection algorithm for use in their web browsers. The algorithm is able to detect all of the most frequently encountered character encodings totally automatically.+ .+ This library wraps up their library and exposes a very simple Haskell interface to it. The library is portable, and is confirmed to work on both Unix and Windows.+ .+ This library is a /maintained/ fork of charsetdetect:+ .+ * It compiles with recent version of bytestring.+ * It works correctly in presence of Template Haskell on GHC 7.6.+ * It builds on 64-bit Windows. License: LGPL License-File: LICENSE Author: Max Bolingbroke <batterseapower@hotmail.com> Maintainer: Artyom <yom@artyom.me>-Homepage: http://github.com/Aelve/charsetdetect-ae+Homepage: http://github.com/aelve/charsetdetect-ae Build-Type: Simple Extra-Source-Files: libcharsetdetect/README.md@@ -58,7 +62,7 @@ Source-Repository head type: git- location: git://github.com/Aelve/charsetdetect-ae.git+ location: git://github.com/aelve/charsetdetect-ae.git Library Exposed-Modules: Codec.Text.Detect
libcharsetdetect/nspr-emu/prcpucfg_win.h view
@@ -100,7 +100,7 @@ #define PR_BYTES_PER_WORD_LOG2 2 #define PR_BYTES_PER_DWORD_LOG2 2 -#elif defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)+#elif defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_) || defined(__x86_64) #define IS_LITTLE_ENDIAN 1 #undef IS_BIG_ENDIAN