mercurial/encoding.py
changeset 24593 f473a1fe5c7c
parent 24578 ac08de78de7f
child 24597 b4258d5a1600
equal deleted inserted replaced
24592:d7cf8102bf09 24593:f473a1fe5c7c
   352     except UnicodeError:
   352     except UnicodeError:
   353         return s.upper() # we don't know how to fold this except in ASCII
   353         return s.upper() # we don't know how to fold this except in ASCII
   354     except LookupError, k:
   354     except LookupError, k:
   355         raise error.Abort(k, hint="please check your locale settings")
   355         raise error.Abort(k, hint="please check your locale settings")
   356 
   356 
       
   357 class normcasespecs(object):
       
   358     '''what a platform's normcase does to ASCII strings
       
   359 
       
   360     This is specified per platform, and should be consistent with what normcase
       
   361     on that platform actually does.
       
   362 
       
   363     lower: normcase lowercases ASCII strings
       
   364     upper: normcase uppercases ASCII strings
       
   365     other: the fallback function should always be called'''
       
   366     lower = -1
       
   367     upper = 1
       
   368     other = 0
       
   369 
   357 _jsonmap = {}
   370 _jsonmap = {}
   358 
   371 
   359 def jsonescape(s):
   372 def jsonescape(s):
   360     '''returns a string suitable for JSON
   373     '''returns a string suitable for JSON
   361 
   374