equal
deleted
inserted
replaced
137 # How to treat ambiguous-width characters. Set to 'wide' to treat as wide. |
137 # How to treat ambiguous-width characters. Set to 'wide' to treat as wide. |
138 wide = (os.environ.get("HGENCODINGAMBIGUOUS", "narrow") == "wide" |
138 wide = (os.environ.get("HGENCODINGAMBIGUOUS", "narrow") == "wide" |
139 and "WFA" or "WF") |
139 and "WFA" or "WF") |
140 |
140 |
141 def colwidth(s): |
141 def colwidth(s): |
142 "Find the column width of a UTF-8 string for display" |
142 "Find the column width of a string for display in the local encoding" |
143 return ucolwidth(s.decode(encoding, 'replace')) |
143 return ucolwidth(s.decode(encoding, 'replace')) |
144 |
144 |
145 def ucolwidth(d): |
145 def ucolwidth(d): |
146 "Find the column width of a Unicode string for display" |
146 "Find the column width of a Unicode string for display" |
147 eaw = getattr(unicodedata, 'east_asian_width', None) |
147 eaw = getattr(unicodedata, 'east_asian_width', None) |