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

DIS-178 - Use mb_substr to preserve diacritics #2190

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

kidclamp
Copy link
Contributor

@kidclamp kidclamp commented Jan 7, 2025

No description provided.

…ing to list

When saving to a list, Aspen saves the title in the user_list_entry table, shortening it to 50 characters

For a title like:
Just being Dalí : the story of artist Salvador Dalí / by Amy Guglielmo ; illustrated by Brett Helquist.

When punctuation removed and string shortened we get:
just being dalí the story of artist salvador dalí

The 50th character being: í

When using substr - the diacritic is cut in half, the string is mangled, and the title can fail to save to the DB
When using mb_substr - the diacritic is preserved

This patch converts all the substr in the file to mb_substr as it is the safer option when using UTF8
To test:
1 - In Koha add the title "Just being Dalí : the story of artist Salvador Dalí / by Amy Guglielmo ; illustrated by Brett Helquist."
    You can grab from LOC via Z39.50
2 - Wait for Aspen to index
3 - Find the title in Aspen, add to a list
4 - Confirmation box appears, but list does not contain title when checked
5 - Apply patch
6 - Repeat
7 - Title successfully added
@mdnoble73 mdnoble73 merged commit e5bc70d into Aspen-Discovery:25.02.00 Jan 9, 2025
3 checks passed
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