Skip to content

fix: keep UTF-8 continuations inside an OSC string - #54

Open
Sash (SashaMIT) wants to merge 1 commit into
Azure:masterfrom
SashaMIT:fix/osc-utf8
Open

Sash (SashaMIT) wants to merge 1 commit into
Azure:masterfrom
SashaMIT:fix/osc-utf8

Conversation

@SashaMIT

@SashaMIT Sash (SashaMIT) commented Oct 11, 2026 •

Copy link
Copy Markdown

Summary

An OSC title that contains U+0410 is the bytes D0 90. 0x90 is also the DCS entry byte, so the parser left the string on the second byte of that character. The following byte then aborted Parse with new state of 'nil' is invalid, and the rest of the stream was dropped.

A continuation that belongs to a multibyte sequence started in the OSC string now stays in the string. A lone 0x90 still enters DCS. A lone 0x9C still ends the string. BEL still ends it.

U+2014 is E2 80 94. The 0x80 in the middle used to return to ground from inside the title. It stays in the string too.

TestOscStringUTF8Continuation covers both titles, then a BEL and a following X. On the old parser the U+0410 case returned the nil-state error. After the change the state is ground and the only call is Print([X]). go test -count=1 ./... passed.

Fixes #40.

A title containing U+0410 (D0 90) treated 0x90 as DCS. The next byte
then aborted Parse with a nil state, so the rest of the stream was dropped.

Signed-off-by: Sasha Mitchell <sash.t.mitchell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

utf-8 encoded Title break processing OscString

1 participant