Repository navigation
Commit c2f91be
committed
Write history files and read pyscripts as UTF-8
history --output-file and history --edit wrote their files in the
locale's encoding, but run_script reads only ASCII or UTF-8 files. On a
locale whose encoding is not UTF-8, such as cp949 on Korean Windows, a
history with non-ASCII text could not be run again: run_script said the
file "is not an ASCII or UTF-8 encoded text file". Both now write UTF-8.
run_pyscript read the script in the locale's encoding, so a UTF-8 script
with non-ASCII text failed with UnicodeDecodeError or ran with garbled
strings. It now reads the script as UTF-8, the default encoding of
Python source, and accepts a byte order mark.1 parent 5649a26 commit c2f91be
4 files changed
Lines changed: 85 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5315 | 5315 | | |
5316 | 5316 | | |
5317 | 5317 | | |
5318 | | - | |
| 5318 | + | |
5319 | 5319 | | |
5320 | 5320 | | |
5321 | 5321 | | |
| |||
5628 | 5628 | | |
5629 | 5629 | | |
5630 | 5630 | | |
5631 | | - | |
| 5631 | + | |
5632 | 5632 | | |
5633 | 5633 | | |
5634 | 5634 | | |
| |||
5644 | 5644 | | |
5645 | 5645 | | |
5646 | 5646 | | |
5647 | | - | |
| 5647 | + | |
5648 | 5648 | | |
5649 | 5649 | | |
5650 | 5650 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1473 | 1473 | | |
1474 | 1474 | | |
1475 | 1475 | | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
1476 | 1529 | | |
1477 | 1530 | | |
1478 | 1531 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
0 commit comments