escaped_string - fix output encoding

This commit is contained in:
artemp 2015-01-05 12:39:56 +01:00
parent fa8feea603
commit c9672b6a9d

View file

@ -33,24 +33,19 @@ escaped_string<OutputIterator>::escaped_string()
{ {
karma::lit_type lit; karma::lit_type lit;
karma::_r1_type _r1; karma::_r1_type _r1;
karma::hex_type hex; karma::char_type char_;
karma::right_align_type right_align;
karma::print_type kprint;
esc_char.add esc_char.add
('"', "\\\"") ('\a', "\\a")
('\\', "\\\\")
('\b', "\\b") ('\b', "\\b")
('\f', "\\f") ('\f', "\\f")
('\n', "\\n") ('\n', "\\n")
('\r', "\\r") ('\r', "\\r")
('\t', "\\t") ('\t', "\\t")
('\v', "\\v")
('"', "\\\"")
; ;
esc_str = lit(_r1)
esc_str = lit(_r1) << *(esc_char | char_)
<< *(esc_char
| kprint
| "\\u" << right_align(4,lit('0'))[hex])
<< lit(_r1) << lit(_r1)
; ;
} }