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

Searching UTF-8 Characters "太陽", "平均", "赤道", "太", "均", etc. Cause App to Crash #1488

Open
marcuswisecaesar opened this issue Feb 2, 2022 · 4 comments

Comments

@marcuswisecaesar
Copy link


Usage environment:
iOS 15.2.1 iPadOS 15.2.1 macOS Monterey 12.1 latest
This bug is reproducible on iOS and macOS

Steps to reproduce the bug that causes the app to crash

  1. Copy the text content from this post - https://www.astroarts.co.jp/alacarte/kiso/kiso01-j.shtml - into a new note.

  2. search in Simplenote's search window with UTF-8 string
    Search keywords are "太陽", "平均", "赤道", "太", "均", etc.

These are the UTF-8 Codes:
592A 太
967D 陽
5E73 平
5747 均
8D64 赤
9053 道

Result:
When the above memo is hit in the search result and displayed on the screen, the Simpenote application crashes.
If there are multiple memos hit in the search results and the above memo is at the bottom, the app crashes when it is displayed by scrolling up.

What I expected:
To be shown the search result for: "太陽" etc.

utf-8.1.mov
@dmsnell
Copy link
Member

dmsnell commented Feb 3, 2022

Thanks for the report @marcuswisecaesar - I'm able to reliably reproduce the issue and I suspect we're cutting the post preview on a non-Unicode boundary since the note displays fine if not in the search.

cc: @jleandroperez

@dmsnell
Copy link
Member

dmsnell commented Feb 3, 2022

Noting a suspicious line:

leadingLimit: Constants.excerptLeadingLimit,
trailingLimit: Constants.excerptTrailingLimit) else {

We're using hard-coded string lengths and I'm wondering if those are cutting in between non-boundaries.

@codebykat codebykat transferred this issue from Automattic/Simplenote-United Oct 10, 2022
@peril-automattic
Copy link

Fails
🚫

Please add a type label to this issue. e.g. '[Type] Enhancement'

🚫 Please add a feature label to this issue. e.g. 'Stats'

Generated by 🚫 dangerJS

@eshurakov
Copy link
Contributor

Most likely related to #1064

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

No branches or pull requests

3 participants