Skip to content

Add basic non-ASCII text support for printing - #1

Merged
AaronChartier merged 2 commits into
AaronChartier:mainfrom
Gnado:fix/non-ascii-text-support
Mar 28, 2026
Merged

Add basic non-ASCII text support for printing#1
AaronChartier merged 2 commits into
AaronChartier:mainfrom
Gnado:fix/non-ascii-text-support

Conversation

@Gnado

@Gnado Gnado commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Summary

This MR adds basic non-ASCII text support for printing by replacing unicode_escape decoding with a safer escape parser for CLI input.

Changes

  • add decode_cli_escapes() to handle common escaped whitespace sequences
  • preserve non-ASCII characters while still supporting \n, \t, \r, and \\

Example input

Hello world
Привет мир
Γειά σου κόσμε
Ciao mondo
Olá mundo
Sveika pasaule
C:\\Users\\Gnado\\Documents
 \n \t \\ \" \'

telegram-cloud-photo-size-2-5325604051288267587-w

@AaronChartier AaronChartier left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! The decode_cli_escapes approach is a solid fix for the non-ASCII corruption issue. Just one small bug to fix in print_file — see inline comment. Once that's updated, this is good to merge! 🎉

Comment thread src/inkjet/cli.py
Comment thread src/inkjet/cli.py Outdated
@Gnado

Gnado commented Mar 27, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in 63903a3. Please take another look.

@AaronChartier AaronChartier left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great — the fix in 63903a3 is correct. Tested locally with accented Latin characters (café, résumé, Olá) and newline escapes on a real printer. Everything works perfectly. Thanks for the contribution! 🎉

@AaronChartier AaronChartier self-assigned this Mar 28, 2026
@AaronChartier
AaronChartier merged commit 8e8c35b into AaronChartier:main Mar 28, 2026
3 checks passed
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.

2 participants