Mercurial > hg
comparison tests/test-hgweb-commands.out @ 11765:aff419e260f9 stable
templatefilters: make json filter handle multibyte characters correctly
It aims to fix javascript error of hgweb's graph view in Japanese 'cp932'
encoding.
'cp932' contains multibyte characters ending with '\x5c' (backslash),
e.g. '\x94\x5c' for Japanese Kanji 'Noh'.
Due to json filter escapes '\' to '\\', multibyte string ending with
'\x5c' is translated to "xxx\", resulting javascript parse error on
a web browser.
This patch changes json() to pass unicode to jsonescape().
Unicode decoding error handler changed to 'replace' by Patrick Mézard.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 07 Aug 2010 16:27:16 +0900 |
parents | db3f6f0e4e7d |
children | a65ea28269ef 9dac951d0185 |
comparison
equal
deleted
inserted
replaced
11758:a79214972da2 | 11765:aff419e260f9 |
---|---|
980 display: block; | 980 display: block; |
981 font-size: 70%; | 981 font-size: 70%; |
982 position: relative; | 982 position: relative; |
983 top: -1px; | 983 top: -1px; |
984 } | 984 } |
985 % Stop and restart with HGENCODING=cp932 | |
986 % Graph json escape of multibyte character | |
987 var data = [["40b4d6888e92", [0, 1], [[0, 0, 1]], "能", "test", "1970-01-01", ["stable", true], ["tip"]], ["1d22e65f027e", [0, 1], [[0, 0, 1]], "branch", "test", "1970-01-01", ["stable", false], []], ["a4f92ed23982", [0, 1], [[0, 0, 1]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "1970-01-01", ["default", true], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "1970-01-01", ["default", false], ["1.0"]]]; | |
985 % ERRORS ENCOUNTERED | 988 % ERRORS ENCOUNTERED |