Show More
@@ -362,13 +362,13 b' def headencode(ui, s, charsets=None, dis' | |||
|
362 | 362 | if not display: |
|
363 | 363 | # split into words? |
|
364 | 364 | s, cs = _encode(ui, s, charsets) |
|
365 | return str(email.header.Header(s, cs)) | |
|
365 | return encoding.strtolocal(email.header.Header(s, cs).encode()) | |
|
366 | 366 | return s |
|
367 | 367 | |
|
368 | 368 | |
|
369 | 369 | def _addressencode(ui, name, addr, charsets=None): |
|
370 | 370 | assert isinstance(addr, bytes) |
|
371 | name = headencode(ui, name, charsets) | |
|
371 | name = encoding.strfromlocal(headencode(ui, name, charsets)) | |
|
372 | 372 | try: |
|
373 | 373 | acc, dom = addr.split(b'@') |
|
374 | 374 | acc.decode('ascii') |
@@ -512,7 +512,8 b' mime encoded mbox (base64):' | |||
|
512 | 512 | X-Mercurial-Series-Id: <909a00e13e9d78b575ae.240@test-hostname> |
|
513 | 513 | User-Agent: Mercurial-patchbomb/* (glob) |
|
514 | 514 | Date: Thu, 01 Jan 1970 00:04:00 +0000 |
|
515 | From: Q <quux> | |
|
515 | From: Q <quux> (no-py3 !) | |
|
516 | From: =?iso-8859-1?q?Q?= <quux> (py3 !) | |
|
516 | 517 |
To: |
|
517 | 518 |
Cc: |
|
518 | 519 | |
@@ -2397,9 +2398,12 b' test multi-address parsing:' | |||
|
2397 | 2398 | User-Agent: Mercurial-patchbomb/* (glob) |
|
2398 | 2399 | Date: Tue, 01 Jan 1980 00:01:00 +0000 |
|
2399 | 2400 | From: quux |
|
2400 | To: spam <spam>, eggs, toast | |
|
2401 | Cc: foo, bar@example.com, "A, B <>" <a@example.com> | |
|
2402 | Bcc: "Quux, A." <quux> | |
|
2401 | To: spam <spam>, eggs, toast (no-py3 !) | |
|
2402 | Cc: foo, bar@example.com, "A, B <>" <a@example.com> (no-py3 !) | |
|
2403 | Bcc: "Quux, A." <quux> (no-py3 !) | |
|
2404 | To: =?iso-8859-1?q?spam?= <spam>, eggs, toast (py3 !) | |
|
2405 | Cc: foo, bar@example.com, =?iso-8859-1?q?A=2C_B_=3C=3E?= <a@example.com> (py3 !) | |
|
2406 | Bcc: =?iso-8859-1?q?Quux=2C_A=2E?= <quux> (py3 !) | |
|
2403 | 2407 | |
|
2404 | 2408 | # HG changeset patch |
|
2405 | 2409 | # User test |
General Comments 0
You need to be logged in to leave comments.
Login now