Package medite :: Package Utile :: Module decodage
[hide private]
[frames] | no frames]

Module decodage

source code

Classes [hide private]
  mapperUnicodeUtf
Map chaque position d'une chaine UTF-8 en leur position Unicode
Functions [hide private]
 
readEncodedFile(chemin, encodage) source code
 
decode_file_heuristically_(chemin)
Try interpreting s using several possible encodings.
source code
 
decode_string_heuristically_(s, enc=None, denc='ascii')
Try interpreting s using several possible encodings.
source code
 
loadFile(chemin, renvoieEnc=False) source code
 
decode_string_heuristically(data)
Given a byte string, attempt to decode it.
source code
 
decode_file_heuristically(chemin) source code
Function Details [hide private]

decode_file_heuristically_(chemin)

source code 
Try interpreting s using several possible encodings. The return value is a three-element tuple. The first element is either an ASCII string or a Unicode object. The second element is 1 if the decoder had to punt and delete some characters from the input to successfully generate a Unicode object.

decode_string_heuristically_(s, enc=None, denc='ascii')

source code 
Try interpreting s using several possible encodings. The return value is a three-element tuple. The first element is either an ASCII string or a Unicode object. The second element is 1 if the decoder had to punt and delete some characters from the input to successfully generate a Unicode object.

decode_string_heuristically(data)

source code 

Given a byte string, attempt to decode it.
Tries the standard 'UTF8' and 'latin-1' encodings,
Plus several gathered from locale information.

The calling program *must* first call 
    locale.setlocale(locale.LC_ALL, '')

If successful it returns 
    (decoded_unicode, successful_encoding)
If unsuccessful it raises a ``UnicodeError``