equal
deleted
inserted
replaced
60 Unicode character, and 'ignore', which drops the character. |
60 Unicode character, and 'ignore', which drops the character. |
61 """ |
61 """ |
62 try: |
62 try: |
63 return s.decode(encoding, encodingmode).encode("utf-8") |
63 return s.decode(encoding, encodingmode).encode("utf-8") |
64 except UnicodeDecodeError, inst: |
64 except UnicodeDecodeError, inst: |
65 sub = s[max(0, inst.start-10):inst.start+10] |
65 sub = s[max(0, inst.start - 10):inst.start + 10] |
66 raise error.Abort("decoding near '%s': %s!" % (sub, inst)) |
66 raise error.Abort("decoding near '%s': %s!" % (sub, inst)) |
67 except LookupError, k: |
67 except LookupError, k: |
68 raise error.Abort("%s, please check your locale settings" % k) |
68 raise error.Abort("%s, please check your locale settings" % k) |
69 |
69 |
70 def colwidth(s): |
70 def colwidth(s): |