FIX z_string:s_utf8/2 #439

Merged
merged 1 commit into from Oct 9, 2012

Conversation

Projects
None yet
2 participants
@motiejus
Contributor

motiejus commented Oct 5, 2012

Current checker does not validate that codepoints are within allowed
range. For instance, this encodes U-00000, but passes the current
validator: <<2#110:3, 0:5, 2#10:2, 0:6>>. (<<16#C080>>).

New checker takes into account both utf8 syntax and allowed values that
certain length codepoints can encode.

Background: I was looking for an Erlang utf-8 validator and generator for a bigger project and came across this one. Validator was wrong, so I fixed it. Since there is also a PropEr generator and PropEr test suite, it has a separate repository:
https://github.com/Motiejus/z_string

Note: I did not include PropEr test suite, because PropEr is another dependency. For a more complete test suite see the link above.

FIX z_string:s_utf8/2
Current checker does not validate that codepoints are within allowed
range. For instance, this encodes U-00000, but passes the current
validator: <<2#110:3, 0:5, 2#10:2, 0:6>>. (<<16#C080>>).

New checker takes into account both utf8 syntax and allowed values that
certain length codepoints can encode.
@mworrell

This comment has been minimized.

Show comment Hide comment
@mworrell

mworrell Oct 9, 2012

This looks good to me.
Code is more maintainable than the code we have now.

This looks good to me.
Code is more maintainable than the code we have now.

@mworrell

This comment has been minimized.

Show comment Hide comment
@mworrell

mworrell Oct 9, 2012

Owner

Is your name already in the Contributors file?
If not, with which name/e-mail would you like to be mentioned?

Owner

mworrell commented Oct 9, 2012

Is your name already in the Contributors file?
If not, with which name/e-mail would you like to be mentioned?

mworrell added a commit that referenced this pull request Oct 9, 2012

@mworrell mworrell merged commit 932e95f into zotonic:master Oct 9, 2012

@mworrell

This comment has been minimized.

Show comment Hide comment
@mworrell

mworrell Oct 9, 2012

Owner

Thanks!

Owner

mworrell commented Oct 9, 2012

Thanks!

@motiejus

This comment has been minimized.

Show comment Hide comment
@motiejus

motiejus Oct 9, 2012

Contributor

Thanks for merging.

As for name and email, please include the one in the commit message.

Contributor

motiejus commented Oct 9, 2012

Thanks for merging.

As for name and email, please include the one in the commit message.

rpip pushed a commit to rpip/zotonic that referenced this pull request Aug 12, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment