Skip to content

Conversation

@iorsh
Copy link
Contributor

@iorsh iorsh commented Feb 2, 2024

Unicode strings are currently improperly converted when saved to SFD file. Specifically, conversion step to UTF-16 is skipped, effectively breaking all supplementary plane characters (like emojis or music notation).

This PR introduces proper conversion to/from UTF-16, TTF names like "😀𝄞" are now correctly stored in SFD.

Type of change

  • Bug fix

This fixes the issue of SFDDumpUTF7Str{}/SFDReadUTF7Str() mentioned by @mf2vec-dev in #5354

Copy link
Contributor

@skef skef left a comment

Choose a reason for hiding this comment

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

I'm able to properly review maybe 70% of this, with the other 30% (the specifics of these transcodings down to the individual operations) left on trust.

@skef
Copy link
Contributor

skef commented Feb 4, 2024

@JoesCat Happen to want to take a look at this before I merge?

@iorsh
Copy link
Contributor Author

iorsh commented Feb 4, 2024

Regression testing (using bulk_test.sh, see #5365) passed with

FF_PY_SCRIPT_LINE="f=fontforge.open(argv[1]); f.save(argv[2])"
FF_OUTPUT_FILE="Output.sfd"

Each SFD file opened and saved anew with this PR and 20230101 respectively, all files are identical.

@skef skef merged commit ba9f786 into fontforge:master Feb 6, 2024
@iorsh iorsh deleted the utf7_suppl branch March 28, 2025 07:28
@iorsh iorsh mentioned this pull request Nov 21, 2025
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