Catch the exception if decoding failed.
[pymailheaders.git] / chardet / constants.py
blobe94e226b0a98cbd6cb6ed761637935ea615ee94a
1 ######################## BEGIN LICENSE BLOCK ########################
2 # The Original Code is Mozilla Universal charset detector code.
4 # The Initial Developer of the Original Code is
5 # Netscape Communications Corporation.
6 # Portions created by the Initial Developer are Copyright (C) 2001
7 # the Initial Developer. All Rights Reserved.
9 # Contributor(s):
10 # Mark Pilgrim - port to Python
11 # Shy Shalom - original C code
13 # This library is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU Lesser General Public
15 # License as published by the Free Software Foundation; either
16 # version 2.1 of the License, or (at your option) any later version.
18 # This library is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 # Lesser General Public License for more details.
23 # You should have received a copy of the GNU Lesser General Public
24 # License along with this library; if not, write to the Free Software
25 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 # 02110-1301 USA
27 ######################### END LICENSE BLOCK #########################
29 _debug = 0
31 eDetecting = 0
32 eFoundIt = 1
33 eNotMe = 2
35 eStart = 0
36 eError = 1
37 eItsMe = 2
39 SHORTCUT_THRESHOLD = 0.95
41 import __builtin__
42 if not hasattr(__builtin__, 'False'):
43 False = 0
44 True = 1
45 else:
46 False = __builtin__.False
47 True = __builtin__.True