Check if the character at the start of the buffer can be printed unescaped.
(b []byte, i int)
| 83 | |
| 84 | // Check if the character at the start of the buffer can be printed unescaped. |
| 85 | func is_printable(b []byte, i int) bool { |
| 86 | return ((b[i] == 0x0A) || // . == #x0A |
| 87 | (b[i] >= 0x20 && b[i] <= 0x7E) || // #x20 <= . <= #x7E |
| 88 | (b[i] == 0xC2 && b[i+1] >= 0xA0) || // #0xA0 <= . <= #xD7FF |
| 89 | (b[i] > 0xC2 && b[i] < 0xED) || |
| 90 | (b[i] == 0xED && b[i+1] < 0xA0) || |
| 91 | (b[i] == 0xEE) || |
| 92 | (b[i] == 0xEF && // #xE000 <= . <= #xFFFD |
| 93 | !(b[i+1] == 0xBB && b[i+2] == 0xBF) && // && . != #xFEFF |
| 94 | !(b[i+1] == 0xBF && (b[i+2] == 0xBE || b[i+2] == 0xBF)))) |
| 95 | } |
| 96 | |
| 97 | // Check if the character at the specified position is NUL. |
| 98 | func is_z(b []byte, i int) bool { |
no outgoing calls
no test coverage detected