Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51dfd77f3c | ||
|
|
2e3e61a2b4 | ||
|
|
52aabc47cd | ||
|
|
8925f398af | ||
|
|
7adcda8547 | ||
|
|
59b81ad775 | ||
|
|
8727ac25a5 | ||
|
|
6284c1a677 | ||
|
|
f1a2889bfe | ||
|
|
7c07f48a45 | ||
|
|
4be65c2f13 | ||
|
|
63e17e9a22 | ||
|
|
de78ca5f34 | ||
|
|
2be6331521 | ||
|
|
2e910834dc | ||
|
|
e5e64a794f |
22
.gitignore
vendored
Normal file
22
.gitignore
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
### Haskell ###
|
||||
dist
|
||||
dist-*
|
||||
cabal-dev
|
||||
*.o
|
||||
*.hi
|
||||
*.chi
|
||||
*.chs.h
|
||||
*.dyn_o
|
||||
*.dyn_hi
|
||||
.hpc
|
||||
.hsenv
|
||||
.cabal-sandbox/
|
||||
cabal.sandbox.config
|
||||
*.prof
|
||||
*.aux
|
||||
*.hp
|
||||
*.eventlog
|
||||
.stack-work/
|
||||
cabal.project.local
|
||||
.HTF/
|
||||
|
||||
18
CHANGELOG
18
CHANGELOG
@ -1,3 +1,21 @@
|
||||
Changes from 0.8 to 0.8.2
|
||||
-------------------------
|
||||
|
||||
* Deprecated support for very old GHCs
|
||||
* Updated cabal file to differentiate between build dependencies and setup dependencies
|
||||
* Add upper and lower bounds to build dependencies
|
||||
* Stack compatibility
|
||||
|
||||
Changes from 0.8 to 0.8.1
|
||||
-------------------------
|
||||
|
||||
* Added the ShiftJIS and CP932 encodings
|
||||
|
||||
Changes from 0.7.0.2 to 0.8
|
||||
---------------------------
|
||||
|
||||
* GHC-7.10/AMP compatibility
|
||||
|
||||
Changes from 0.7.0.1 to 0.7.0.2
|
||||
-------------------------------
|
||||
|
||||
|
||||
@ -76,6 +76,7 @@ import Data.Encoding.MacOSRoman
|
||||
import Data.Encoding.JISX0201
|
||||
import Data.Encoding.JISX0208
|
||||
import Data.Encoding.ISO2022JP
|
||||
import Data.Encoding.ShiftJIS
|
||||
import Data.Encoding.CP437
|
||||
import Data.Encoding.CP737
|
||||
import Data.Encoding.CP775
|
||||
@ -92,6 +93,7 @@ import Data.Encoding.CP865
|
||||
import Data.Encoding.CP866
|
||||
import Data.Encoding.CP869
|
||||
import Data.Encoding.CP874
|
||||
import Data.Encoding.CP932
|
||||
import Data.Char
|
||||
import Text.Regex
|
||||
|
||||
@ -327,6 +329,9 @@ encodingFromStringExplicit codeName = case (normalizeEncoding codeName) of
|
||||
"jis_x_0208" -> Just $ DynEncoding JISX0208
|
||||
-- ISO 2022-JP
|
||||
"iso_2022_jp" -> Just $ DynEncoding ISO2022JP
|
||||
-- Shift JIS
|
||||
"shift_jis" -> Just $ DynEncoding ShiftJIS
|
||||
"sjis" -> Just $ DynEncoding ShiftJIS
|
||||
-- MSDOS codepages
|
||||
"cp437" -> Just $ DynEncoding CP437
|
||||
"cp737" -> Just $ DynEncoding CP737
|
||||
@ -344,6 +349,7 @@ encodingFromStringExplicit codeName = case (normalizeEncoding codeName) of
|
||||
"cp866" -> Just $ DynEncoding CP866
|
||||
"cp869" -> Just $ DynEncoding CP869
|
||||
"cp874" -> Just $ DynEncoding CP874
|
||||
"cp932" -> Just $ DynEncoding CP932
|
||||
-- defaults to nothing
|
||||
_ -> Nothing
|
||||
where
|
||||
|
||||
@ -11,6 +11,7 @@ import Data.Word
|
||||
import Data.Foldable (toList)
|
||||
import Control.Throws
|
||||
import Control.Exception.Extensible
|
||||
import Control.Applicative
|
||||
import Control.Monad.State
|
||||
import Control.Monad.Identity
|
||||
import Control.Monad.Reader
|
||||
@ -80,6 +81,13 @@ instance ByteSink PutM where
|
||||
|
||||
newtype PutME a = PutME (Either EncodingException (PutM (),a))
|
||||
|
||||
instance Functor PutME where
|
||||
fmap = liftM
|
||||
|
||||
instance Applicative PutME where
|
||||
pure = return
|
||||
(<*>) = ap
|
||||
|
||||
instance Monad PutME where
|
||||
return x = PutME $ Right (return (),x)
|
||||
(PutME x) >>= g = PutME $ do
|
||||
@ -114,6 +122,13 @@ instance (Monad m,Throws EncodingException m) => ByteSink (StateT (Seq Char) m)
|
||||
|
||||
newtype StrictSink a = StrictS (Ptr Word8 -> Int -> Int -> IO (a,Ptr Word8,Int,Int))
|
||||
|
||||
instance Functor StrictSink where
|
||||
fmap = liftM
|
||||
|
||||
instance Applicative StrictSink where
|
||||
pure = return
|
||||
(<*>) = ap
|
||||
|
||||
instance Monad StrictSink where
|
||||
return x = StrictS $ \cstr pos max -> return (x,cstr,pos,max)
|
||||
(StrictS f) >>= g = StrictS (\cstr pos max -> do
|
||||
@ -140,6 +155,13 @@ instance ByteSink StrictSink where
|
||||
|
||||
newtype StrictSinkE a = StrictSinkE (StrictSink (Either EncodingException a))
|
||||
|
||||
instance Functor StrictSinkE where
|
||||
fmap = liftM
|
||||
|
||||
instance Applicative StrictSinkE where
|
||||
pure = return
|
||||
(<*>) = ap
|
||||
|
||||
instance Monad StrictSinkE where
|
||||
return = StrictSinkE . return . Right
|
||||
(StrictSinkE s) >>= g = StrictSinkE $ do
|
||||
@ -167,6 +189,13 @@ createStrict sink = createStrictWithLen sink 32
|
||||
|
||||
newtype StrictSinkExplicit a = StrictSinkExplicit (StrictSink (Either EncodingException a))
|
||||
|
||||
instance Functor StrictSinkExplicit where
|
||||
fmap = liftM
|
||||
|
||||
instance Applicative StrictSinkExplicit where
|
||||
pure = return
|
||||
(<*>) = ap
|
||||
|
||||
instance Monad StrictSinkExplicit where
|
||||
return = (StrictSinkExplicit).return.Right
|
||||
(StrictSinkExplicit sink) >>= f
|
||||
|
||||
7941
Data/Encoding/CP932.xml
Normal file
7941
Data/Encoding/CP932.xml
Normal file
File diff suppressed because it is too large
Load Diff
7093
Data/Encoding/ShiftJIS.xml
Normal file
7093
Data/Encoding/ShiftJIS.xml
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,15 +1,15 @@
|
||||
Name: encoding
|
||||
Version: 0.7.0.2
|
||||
Version: 0.8.2
|
||||
Author: Henning Günther
|
||||
Maintainer: daniel@wagner-home.com
|
||||
License: BSD3
|
||||
License-File: LICENSE
|
||||
Synopsis: A library for various character encodings
|
||||
Description:
|
||||
Haskell has excellect handling of unicode, the Char type covers all unicode chars. Unfortunatly, there's no possibility to read or write something to the outer world in an encoding other than ascii due to the lack of support for encodings. This library should help with that.
|
||||
Haskell has excellect handling of unicode, the Char type covers all unicode chars. Unfortunately, there's no possibility to read or write something to the outer world in an encoding other than ascii due to the lack of support for encodings. This library should help with that.
|
||||
Category: Codec
|
||||
Homepage: http://code.haskell.org/encoding/
|
||||
Cabal-Version: >=1.6
|
||||
Cabal-Version: >=1.8
|
||||
Build-Type: Custom
|
||||
Extra-Source-Files:
|
||||
CHANGELOG
|
||||
@ -22,28 +22,36 @@ Extra-Source-Files:
|
||||
system_encoding.h
|
||||
system_encoding.c
|
||||
|
||||
Flag splitBase
|
||||
description: Choose the new smaller, split-up base package.
|
||||
Flag systemEncoding
|
||||
description: Provide the getSystemEncoding action to query the locale.
|
||||
|
||||
Source-Repository head
|
||||
Type: darcs
|
||||
Location: http://code.haskell.org/encoding
|
||||
Type: git
|
||||
Location: http://github.com/dmwit/encoding
|
||||
|
||||
Source-Repository this
|
||||
Type: darcs
|
||||
Location: http://code.haskell.org/encoding
|
||||
Tag: 0.7.0.2
|
||||
Type: git
|
||||
Location: http://github.com/dmwit/encoding
|
||||
Tag: 0.8.2
|
||||
|
||||
Custom-Setup
|
||||
Setup-Depends: base >=3 && <5,
|
||||
Cabal >=1.24 && <1.25,
|
||||
containers,
|
||||
filepath,
|
||||
ghc-prim,
|
||||
HaXml >=1.22 && <1.26
|
||||
|
||||
Library
|
||||
Build-Depends: binary < 0.8, extensible-exceptions, HaXml >= 1.22 && < 1.25
|
||||
if flag(splitBase)
|
||||
Build-Depends: bytestring, base >= 3 && < 5, mtl, containers, array, regex-compat
|
||||
if impl(ghc >= 6.10)
|
||||
Build-Depends: ghc-prim
|
||||
else
|
||||
Build-Depends: base < 3
|
||||
Build-Depends: array >=0.4 && <0.6,
|
||||
base >=4 && <5,
|
||||
binary >=0.7 && <0.10,
|
||||
bytestring >=0.9 && <0.11,
|
||||
containers >=0.4 && <0.6,
|
||||
extensible-exceptions >=0.1 && <0.2,
|
||||
ghc-prim >=0.3 && <0.6,
|
||||
mtl >=2.0 && <2.3,
|
||||
regex-compat >=0.71 && <0.95
|
||||
|
||||
Extensions: CPP
|
||||
|
||||
@ -91,6 +99,7 @@ Library
|
||||
Data.Encoding.JISX0212
|
||||
Data.Encoding.ISO2022
|
||||
Data.Encoding.ISO2022JP
|
||||
Data.Encoding.ShiftJIS
|
||||
Data.Encoding.CP437
|
||||
Data.Encoding.CP737
|
||||
Data.Encoding.CP775
|
||||
@ -107,6 +116,7 @@ Library
|
||||
Data.Encoding.CP866
|
||||
Data.Encoding.CP869
|
||||
Data.Encoding.CP874
|
||||
Data.Encoding.CP932
|
||||
System.IO.Encoding
|
||||
Other-Modules:
|
||||
Data.Encoding.Base
|
||||
@ -114,6 +124,8 @@ Library
|
||||
Data.Map.Static
|
||||
Data.Static
|
||||
Data.CharMap
|
||||
if impl(ghc >= 7.10)
|
||||
GHC-Options: -fno-warn-tabs
|
||||
if flag(systemEncoding)
|
||||
Includes:
|
||||
system_encoding.h
|
||||
@ -122,3 +134,16 @@ Library
|
||||
C-Sources:
|
||||
system_encoding.c
|
||||
CPP-Options: -DSYSTEM_ENCODING
|
||||
|
||||
test-suite encoding-test
|
||||
type: exitcode-stdio-1.0
|
||||
hs-source-dirs: tests
|
||||
main-is: Main.hs
|
||||
other-modules: Test.Tester
|
||||
, Test.Tests
|
||||
build-depends: base
|
||||
, bytestring
|
||||
, encoding
|
||||
, HUnit
|
||||
, QuickCheck
|
||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N
|
||||
|
||||
66
stack.yaml
Normal file
66
stack.yaml
Normal file
@ -0,0 +1,66 @@
|
||||
# This file was automatically generated by 'stack init'
|
||||
#
|
||||
# Some commonly used options have been documented as comments in this file.
|
||||
# For advanced use and comprehensive documentation of the format, please see:
|
||||
# http://docs.haskellstack.org/en/stable/yaml_configuration/
|
||||
|
||||
# Resolver to choose a 'specific' stackage snapshot or a compiler version.
|
||||
# A snapshot resolver dictates the compiler version and the set of packages
|
||||
# to be used for project dependencies. For example:
|
||||
#
|
||||
# resolver: lts-3.5
|
||||
# resolver: nightly-2015-09-21
|
||||
# resolver: ghc-7.10.2
|
||||
# resolver: ghcjs-0.1.0_ghc-7.10.2
|
||||
# resolver:
|
||||
# name: custom-snapshot
|
||||
# location: "./custom-snapshot.yaml"
|
||||
resolver: lts-8.22
|
||||
|
||||
# User packages to be built.
|
||||
# Various formats can be used as shown in the example below.
|
||||
#
|
||||
# packages:
|
||||
# - some-directory
|
||||
# - https://example.com/foo/bar/baz-0.0.2.tar.gz
|
||||
# - location:
|
||||
# git: https://github.com/commercialhaskell/stack.git
|
||||
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
|
||||
# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a
|
||||
# extra-dep: true
|
||||
# subdirs:
|
||||
# - auto-update
|
||||
# - wai
|
||||
#
|
||||
# A package marked 'extra-dep: true' will only be built if demanded by a
|
||||
# non-dependency (i.e. a user package), and its test suites and benchmarks
|
||||
# will not be run. This is useful for tweaking upstream packages.
|
||||
packages:
|
||||
- '.'
|
||||
# Dependency packages to be pulled from upstream that are not in the resolver
|
||||
# (e.g., acme-missiles-0.3)
|
||||
extra-deps: []
|
||||
|
||||
# Override default flag values for local packages and extra-deps
|
||||
flags: {}
|
||||
|
||||
# Extra package databases containing global packages
|
||||
extra-package-dbs: []
|
||||
|
||||
# Control whether we use the GHC we find on the path
|
||||
# system-ghc: true
|
||||
#
|
||||
# Require a specific version of stack, using version ranges
|
||||
# require-stack-version: -any # Default
|
||||
# require-stack-version: ">=1.4"
|
||||
#
|
||||
# Override the architecture used by stack, especially useful on Windows
|
||||
# arch: i386
|
||||
# arch: x86_64
|
||||
#
|
||||
# Extra directories used by stack for building
|
||||
# extra-include-dirs: [/path/to/dir]
|
||||
# extra-lib-dirs: [/path/to/dir]
|
||||
#
|
||||
# Allow a newer minor version of GHC than the snapshot specifies
|
||||
# compiler-check: newer-minor
|
||||
Loading…
Reference in New Issue
Block a user