Mercurial > hg
diff tests/test-encoding-align.t @ 15031:0cb27eda3a1e
util: wrap lines with multi-byte characters correctly (issue2943)
This re-introduces the unicode conversion what was lost in d320e70442a5 5 years
ago and had the comment:
To avoid corrupting multi-byte characters in line, we must wrap
a Unicode string instead of a bytestring.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Sat, 06 Aug 2011 23:52:20 +0200 |
parents | b911cb80c671 |
children | 24efa83d81cb |
line wrap: on
line diff
--- a/tests/test-encoding-align.t Mon Aug 08 11:34:52 2011 +0100 +++ b/tests/test-encoding-align.t Sat Aug 06 23:52:20 2011 +0200 @@ -22,14 +22,14 @@ > cmdtable = { > 'showoptlist': > (showoptlist, - > [('s', 'opt1', '', 'short width', '""" + s + """'), - > ('m', 'opt2', '', 'middle width', '""" + m + """'), - > ('l', 'opt3', '', 'long width', '""" + l + """') + > [('s', 'opt1', '', 'short width' + ' %(s)s' * 8, '%(s)s'), + > ('m', 'opt2', '', 'middle width' + ' %(m)s' * 8, '%(m)s'), + > ('l', 'opt3', '', 'long width' + ' %(l)s' * 8, '%(l)s') > ], > "" > ) > } - > """) + > """ % globals()) > f.close() > EOF $ S=`cat s` @@ -52,9 +52,11 @@ options: - -s --opt1 \xe7\x9f\xad\xe5\x90\x8d short width (esc) - -m --opt2 MIDDLE_ middle width - -l --opt3 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d long width (esc) + -s --opt1 \xe7\x9f\xad\xe5\x90\x8d short width \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d (esc) + -m --opt2 MIDDLE_ middle width MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_ + MIDDLE_ MIDDLE_ MIDDLE_ + -l --opt3 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d long width \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc) + \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc) use "hg -v help showoptlist" to show global options