… | |
… | |
842 | |
842 | |
843 | // some utf-8 decoders "decode" surrogate characters: let's fix this. |
843 | // some utf-8 decoders "decode" surrogate characters: let's fix this. |
844 | if (IN_RANGE_INC (c, 0xd800, 0xdfff)) |
844 | if (IN_RANGE_INC (c, 0xd800, 0xdfff)) |
845 | c = 0xfffd; |
845 | c = 0xfffd; |
846 | |
846 | |
847 | // rely on wcwidth to tell us the character width, at least for non-latin1 |
847 | // rely on wcwidth to tell us the character width, do wcwidth before |
848 | // do wcwidth before further replacements, as wcwidth might return -1 |
848 | // further replacements, as wcwidth might return -1 for the line |
849 | // for the line drawing characters below as they might be invalid in the current |
849 | // drawing characters below as they might be invalid in the current |
850 | // locale. |
850 | // locale. |
851 | int width = c < 0x100 ? 1 : wcwidth (c); |
851 | int width = WCWIDTH (c); |
852 | |
852 | |
853 | if (charsets [screen.charset] == '0') // DEC SPECIAL |
853 | if (charsets [screen.charset] == '0') // DEC SPECIAL |
854 | { |
854 | { |
855 | // vt100 special graphics and line drawing |
855 | // vt100 special graphics and line drawing |
856 | // 5f-7e standard vt100 |
856 | // 5f-7e standard vt100 |