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

utf8proc: add utf8proc_NFC normalisation wrapper #1420

Merged
merged 1 commit into from Oct 18, 2021

Conversation

cyphar
Copy link
Contributor

@cyphar cyphar commented Oct 10, 2021

Useful since Lua doesn't do this natively, and KOReader plugins might
need to be able to operate on utf8 strings using Lua's built in string
matching which won't match un-normalised strings.

Useful for koreader/koreader#8312.
Signed-off-by: Aleksa Sarai cyphar@cyphar.com


This change is Reviewable

ffi/utf8proc.lua Outdated Show resolved Hide resolved
ffi/utf8proc.lua Outdated Show resolved Hide resolved
@cyphar cyphar marked this pull request as draft October 10, 2021 23:58
@cyphar
Copy link
Contributor Author

cyphar commented Oct 10, 2021

Converted to draft since I might need to add FFI wrappers for a few more utf8proc functions (utf8proc_category and some usage of utf8proc_iterate).

Useful since Lua doesn't do this natively, and KOReader plugins might
need to be able to operate on utf8 strings using Lua's built in string
matching which won't match un-normalised strings.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
@cyphar
Copy link
Contributor Author

cyphar commented Oct 16, 2021

I don't think any other UTF-8 wrappers are necessary at the moment. As mentioned in other PRs, I will take a look at a rework of the UTF-8 handling in KOReader (which will require a few more wrappers to be provided by koreader-base) but for the Japanese Plugin this is all that is strictly necessary.

@cyphar cyphar marked this pull request as ready for review October 16, 2021 14:51
@poire-z poire-z merged commit e39f49c into koreader:master Oct 18, 2021
@cyphar cyphar deleted the utf8-normalise branch October 18, 2021 14:21
roygbyte pushed a commit to roygbyte/koreader-base that referenced this pull request Mar 3, 2022
Useful since Lua doesn't do this natively, and KOReader plugins might
need to be able to operate on utf8 strings using Lua's built in string
matching which won't match un-normalised strings.
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

4 participants