We have moved to a new Sailfish OS Forum. Please start new discussions there.
10

Apostrophe support in People [released]

asked 2016-05-25 11:47:41 +0300

IZ1IVA gravatar image

updated 2016-10-24 12:39:39 +0300

Hello,

I've noticed that contacts with an apostrophe in their names cannot be found when looked up by that in the search box.

Example: a contact whose name is Robert D'Arcy will only show up is the search terms are parts of its first name (R, Ro, Rob, etc.) or the letter(s) before the apostrophe in its surname (D, in this case). As soon as the apostrophy is included in the search terms, the list goes blank.

This is an issue in some countries/languages.

Thank you

EDIT: released in Sailfish OS 2.0.4

edit retag flag offensive reopen delete

The question has been closed for the following reason "released in a software update" by IZ1IVA
close date 2016-10-24 12:38:39.280719

Comments

2

@IZ1IVA - I'm interested in this as a subject, even though it doesn't appear to affect my usage under normal circumstances; i.e. writing a text, where I will and do use apostrophes where applicable.

So, as a noob to all things Linux and Qt/QML, I've started digging around the interweb and playing with files on my phone, including using your example of Robert D'Arcy as a contact in People.

As you clearly explain, when searching for a contact whose name contains an apostrophe, the search draws a blank as soon as you type the apostrophe. BUT, that depends on how you type the name and of course, what I'm about to explain, is NOT the way anyone would search, but my point is, this could be working as YOU need it to.....I digress, try this to see what I'm getting at;

Open People, go to Search box and type; D'Arcy, keeping the name as you've just typed it, place your cursor to the left of the apostrophe and delete the D - now type the D back in...and watch Robert D'Arcy appear in the search - (or delete and retype the apostrophe, same thing happens) something is face about arse within the file - of course I'm no expert by any means - but finding this out may mean something to someone far more talented than I.

Hope this makes some sense and I realise it is in no way 'an answer', hence making as a comment only.

My mind now boggles with how to solve this and where exactly to look...first port of call; /usr/share/jolla-contacts

Spam Hunter ( 2016-05-25 16:19:46 +0300 )edit

ahahahahah yes, your workaround is very clever @Markkyboy, I've never thought of that!

IZ1IVA ( 2016-05-25 16:56:31 +0300 )edit
2

no, no, please, it's not a workaround - or at least I hadn't considered it a workaround - but more of a starting point for finding out how to solve the issue. :)

Spam Hunter ( 2016-05-25 17:11:08 +0300 )edit

You can also simply drop the apostrophe while inputting the name;

Darcy

Robert D'Arcy

Spam Hunter ( 2016-05-25 19:37:36 +0300 )edit
1

Apparently I can't... maybe because of the different locale (Italian in my case)?

IZ1IVA ( 2016-05-26 12:17:48 +0300 )edit

1 Answer

Sort by » oldest newest most voted
4

answered 2016-05-25 13:46:58 +0300

As someone who has implemented a list search function in QML+JavaScript, I suppose this has something to do with the fact that ' and " are used for seperating strings of text from lines of code. I suppose they are either parsed incorrectly or blacklisted to prevent errors.

edit flag offensive delete publish link more

Comments

This makes sense @jollailija. Do you think it could be feasible to make the parser "auto-escape" these chars?

IZ1IVA ( 2016-05-25 16:58:48 +0300 )edit
1

I'd say they are blacklisted - rather, they are not coded to the tokenizer or parser.

See the common.js script found in /usr/share/jolla-contacts/pages/common/* - line 236

var tokenizer = /[^<]*(<[^>]+>)?/g
var parser = /([^>]*)<([^>]+)>?/
Spam Hunter ( 2016-05-25 19:44:02 +0300 )edit

Thank you @Markkyboy, let's hope the devs will find a way to implement proper apostrophe handling...

IZ1IVA ( 2016-05-26 16:04:02 +0300 )edit

Question tools

Follow
1 follower

Stats

Asked: 2016-05-25 11:47:41 +0300

Seen: 461 times

Last updated: Oct 24 '16