encoding: braille semicolon mapped to the wrong cell - #1990
Conversation
The braille() encoder mapped ';' to U+2830 (dots 5,6), which is the
letter-sign / grade-1 indicator cell, not a semicolon. English Braille --
and UEB, and the French and German codes -- all encode the semicolon as
dots 2,3 = U+2806. Every other punctuation mark in the map already follows
that standard (comma dot 2, colon dots 2,5, period dots 2,5,6, ...), so this
was an isolated transcription error, not a code-variant choice.
Effect: any ';' in a payload was braille-encoded to the wrong character.
Added test_braille_punctuation_cells, which pins the exact cell for each
punctuation mark; it fails on the old value (';' -> U+2830) and passes on
U+2806.
Signed-off-by: WatchTree-19 <119982314+WatchTree-19@users.noreply.github.com>
jmartin-tech
left a comment
There was a problem hiding this comment.
There is conflicting information here:
Braille_ASCII suggests, backed by some historical mailing lists, that ; should map to Letter as dots 5,6 which matches the existing implementation, this is based specifically on how ASCII is mapped which may differ from English, though I am not sure this standard holds any official authority it may influence what an LLM considers to be the translation value.
A commercial reference https://www.pharmabraille.com/pharmaceutical-braille/the-braille-alphabet/ , the UEB standard, German Braille and related teaching references agrees with the change to dot 2,3 in this PR.
This suggests there may be variance in encodings and various models may decode these values in different ways.
I can confirm this definitely impacts tested source payloads as ; is used heavily in html string formats and injection targeted strings, expanding the potential there are false positive or false negatives to explore related to this probe.
Summary
The
braille()encoder ingarak/probes/encoding.pymaps;toU+2830(⠰, dots 5,6), which is the letter-sign / grade-1 indicator cell, not a semicolon. English Braille — and UEB, and the French and German codes — all encode the semicolon as dots 2,3 =U+2806(⠆).Every other punctuation mark in the same map already follows that standard:
,:.!?;So this is an isolated transcription error rather than a code-variant choice. Effect: any
;in a payload was braille-encoded to the wrong character.Fix
One-character map correction,
;→U+2806.Test
There was no test exercising the braille map's individual cells. Added
test_braille_punctuation_cells, which pins the exact cell for each punctuation mark. It fails on the old value:and passes after the fix.
(Noticed while auditing character-map encoders — the same error exists in Microsoft PyRIT's braille converter, filed separately there.)