Changeset 15368 for src/Pugs/Parser

Show
Ignore:
Timestamp:
02/26/07 19:15:36 (21 months ago)
Author:
audreyt
Message:

* gaal++ pointed that for all non-UTF8 unicode encodings

we need to removeCRLF _after_ the decoding, not _before_.
(for UTF8 it's the same thing, so we preserve better chunkiness.)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Parser/Program.hs

    r15365 r15368  
    3434decodeProgram :: String -> String 
    3535decodeProgram str = case detectSourceEncoding str of 
    36     UTF8 xs                 -> decodeUTF8    (removeCRLF xs) 
    37     UTF16 LittleEndian xs   -> decodeUTF16LE (removeCRLF xs) 
    38     UTF16 BigEndian xs      -> decodeUTF16BE (removeCRLF xs) 
    39     UTF32 LittleEndian xs   -> decodeUTF32LE (removeCRLF xs) 
    40     UTF32 BigEndian xs      -> decodeUTF32BE (removeCRLF xs) 
     36    UTF8 xs                 -> decodeUTF8 (removeCRLF xs) 
     37    UTF16 LittleEndian xs   -> removeCRLF (decodeUTF16LE xs) 
     38    UTF16 BigEndian xs      -> removeCRLF (decodeUTF16BE xs) 
     39    UTF32 LittleEndian xs   -> removeCRLF (decodeUTF32LE xs) 
     40    UTF32 BigEndian xs      -> removeCRLF (decodeUTF32BE xs) 
    4141    where 
    4242    removeCRLF ('\r':'\n':xs)   = '\n':removeCRLF xs