Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace invalid codepoints with U+FFFD (REPLACEMENT CHARACTER) #27

Closed
wants to merge 1 commit into from

Conversation

KonstantinRitt
Copy link
Contributor

This is what Unicode suggests to do.
In contrast to raising an error (which only useful when there is
someone to catch that error), this allows to skip the codepoint
validity checks in the hb_unicode callbacks.

This is what Unicode suggests to do.
In contrast to raising an error (which only useful when there is
someone to catch that error), this allows to skip the codepoint
validity checks in the hb_unicode callbacks.
behdad added a commit that referenced this pull request Jul 11, 2014
Only if the font doesn't support it.  Ie, this gives the user to
use non-Unicode codepoints as private values and return a meaningful
glyph for them.  But if it's invalid and font callback doesn't
like it, and if font has U+FFFD, show that instead.

Font functions that do not want this automatic replacement to
happen should return true from get_glyph() if unicode > 0x10FFFF.

Replaces #27
@behdad
Copy link
Member

behdad commented Jul 11, 2014

I fixed it this way instead:
efe7421

It's important to NOT lose the error. Here's how Pango prevents the automatic replacement and draw its own invalid-byte shape:
https://git.gnome.org/browse/pango/commit/?id=9f67b924eb662f498f4e643ed740ce84640968f7

@behdad behdad closed this Jul 11, 2014
gpgreen pushed a commit to gpgreen/harfbuzz that referenced this pull request Jan 10, 2024
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.

None yet

2 participants