Skip to content

dos: add Latin-1 to UTF-8 conversion for stdout#237

Open
reinauer wants to merge 1 commit into
cnvogelg:mainfrom
reinauer:latin-to-utf8
Open

dos: add Latin-1 to UTF-8 conversion for stdout#237
reinauer wants to merge 1 commit into
cnvogelg:mainfrom
reinauer:latin-to-utf8

Conversation

@reinauer
Copy link
Copy Markdown
Contributor

Amiga programs use Latin-1 (ISO-8859-1) encoding for text output, but
modern terminals typically expect UTF-8. Without conversion, extended
characters (codes 128-255) display incorrectly.

Add Latin1ToUtf8Converter class and use it in both Terminal and
FileHandle write paths when the system stdout uses UTF-8 encoding.

Also fix write() return value to report the original byte count rather
than the converted byte count, as callers expect the number of Amiga
bytes written.

Amiga programs use Latin-1 (ISO-8859-1) encoding for text output, but
modern terminals typically expect UTF-8. Without conversion, extended
characters (codes 128-255) display incorrectly.

Add Latin1ToUtf8Converter class and use it in both Terminal and
FileHandle write paths when the system stdout uses UTF-8 encoding.

Also fix write() return value to report the original byte count rather
than the converted byte count, as callers expect the number of Amiga
bytes written.
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.

1 participant