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

Feature request: Strict mode for decode_entities() #40

Open
bschmalhofer opened this issue Dec 19, 2023 · 1 comment
Open

Feature request: Strict mode for decode_entities() #40

bschmalhofer opened this issue Dec 19, 2023 · 1 comment

Comments

@bschmalhofer
Copy link

Since 2004 decode_entities() supports the merging of surrogate pairs. See http://rt.cpan.org/Ticket/Display.html?id=7785 . This means that for example �� will be decoded into a single code point. My understanding that this not covered in any spec.

I therefore propose to add a function decode_entities_strict() that does the same as decode_entities() but rejects surrogate pairs.

Attached is a sample script that shows the effect-
surrogate_pair.pl.txt

@bschmalhofer bschmalhofer changed the title Feature request: Strict mode for decode_entities Feature request: Strict mode for decode_entities() Dec 19, 2023
@haarg
Copy link
Member

haarg commented Dec 19, 2023

I would like if we could just remove this behavior from decode_entities, but it could be hard to measure the impact.

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

No branches or pull requests

2 participants