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 #2224

Merged
merged 1 commit into from
Jun 17, 2024

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>...

@mattmundell mattmundell requested a review from a team as a code owner June 14, 2024 21:26
Copy link

Conventional Commits Report

Type Number
Changed 1

🚀 Conventional commits found.

@a-h-abdelsalam a-h-abdelsalam merged commit 2701f84 into main Jun 17, 2024
11 checks passed
@a-h-abdelsalam a-h-abdelsalam deleted the g-utf8-substring-2 branch June 17, 2024 08:38
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.

2 participants