[commit: base] dbcs: Support for Windows DBCS and new SBCS with MultiByteToWideChar (631c4a3)

Max Bolingbroke batterseapower at hotmail.com
Tue Apr 23 22:31:48 CEST 2013


Repository : ssh://darcs.haskell.org//srv/darcs/packages/base

On branch  : dbcs

https://github.com/ghc/packages-base/commit/631c4a369f64be252f9f581134dd84b5cf31c6e7

>---------------------------------------------------------------

commit 631c4a369f64be252f9f581134dd84b5cf31c6e7
Author: Max Bolingbroke <batterseapower at hotmail.com>
Date:   Thu Apr 18 21:29:08 2013 +0100

    Support for Windows DBCS and new SBCS with MultiByteToWideChar
    
    Because MultiByteToWideChar/WideCharToMultiByte have a rather unhelpful
    interface, we have to use a lot of binary searching tricks to get them
    to match the iconv-like interface that GHC requires.
    
    Even though the resulting encodings are slow, it does at least mean that we
    now support all of Window's code pages. What's more, since these codecs are
    basically only used for console output there probably won't be a huge volume
    of text to deal with in the common case, so speed is less of a worry.
    
    Note that we will still use GHC's faster table-based custom codec for supported
    SBCSs.

 GHC/IO/Encoding/CodePage.hs     |    4 +-
 GHC/IO/Encoding/CodePage/API.hs |  427 +++++++++++++++++++++++++++++++++++++++
 GHC/IO/Encoding/Types.hs        |   12 +-
 GHC/IO/Handle/Internals.hs      |   17 +-
 GHC/Windows.hs                  |   20 +-
 base.cabal                      |    3 +-
 6 files changed, 458 insertions(+), 25 deletions(-)


Diff suppressed because of size. To see it, use:

    git show 631c4a369f64be252f9f581134dd84b5cf31c6e7



More information about the ghc-commits mailing list