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

Change: replace utf8_substring with g_utf8_substring #2204

Closed
wants to merge 7 commits into from

Conversation

mattmundell
Copy link
Contributor

What

Use the real g_utf8_substring from glib, instead of the copy utf8_substring.

Why

utf8_substring was a workaround for older versions of glib. As the required version of glib is now 2.42 it is safe to use g_utf8_substring.

Simple test: create a note with utf8 text:

$ o m m '<create_note><text>012345678901234567890123456789012345678901234  49
012345678901234567890123456789012345678901234  99
012345678901234567890123456789012345678901234 149
012345678901234567890123456789012345678901234 199
012345678901234567890123456789012345678901234 249
 300th char is the 1EBF after the ti: Mình nói tiếng Việt
the excerpt should end there.</text><nvt oid="1.3.6.1.4.1.25623.1.0.80091"/></create_note>'

Then get the notes with excerpts on:

$ oraw m m '<get_notes details="0"/>'
<get_notes_response status="200" status_text="OK">...<text excerpt="1">012345678901234567890123456789012345678901234  49
012345678901234567890123456789012345678901234  99
012345678901234567890123456789012345678901234 149
012345678901234567890123456789012345678901234 199
012345678901234567890123456789012345678901234 249
 300th char is the 1EBF after the ti: Mình nói tiế</text>...

References

Waits for /pull/2203.

Some of the GET iterator initializers modify their get_data_t arg, so
this allows these initializers to be passed to get_next.

In particular this allows init_note_iterator_all to be passed to
get_next, for a fix to handle_get_notes.  Note that
init_note_iterator_all itself does not modify its get_data_t arg, but
init_note_iterator_all is passed to select_resource_iterator which
also accepts initializers that do modify their get_data_t args.

As a result drop the const from any initializer passed to get_next.
Copy link

Conventional Commits Report

Type Number
Changed 1
Bug Fixes 2

🚀 Conventional commits found.

@timopollmeier timopollmeier deleted the utf8-substring branch September 27, 2024 09:56
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.

1 participant