Skip to content

Normalize query string from NFD to NFC#67

Open
risou wants to merge 1 commit intoazai91:masterfrom
risou:normalize-query-to-nfc
Open

Normalize query string from NFD to NFC#67
risou wants to merge 1 commit intoazai91:masterfrom
risou:normalize-query-to-nfc

Conversation

@risou
Copy link

@risou risou commented Oct 18, 2019

Thank you for your great product!

I got one problem using this workflow.
When we search for files on Google Drive, we cannot get the result correctly if the inputted query includes sonant marks. (e.g. "が")

In my opinion, Alfred seems to treat input strings as utf-8-mac(NFD).
We need to normalize input strings for filtering files correctly.

This pull request has one way of difference for normalize string.
If you are good, please merge this p-r and release a new version.

Another way, we can change this workflow's first script filter as shown below.
If you adopt the following change, close this p-r because it is unnecessary.

- ./google-drive.rb --filter "$1"
+ ./google-drive.rb --filter $(echo "$1" | iconv -f "UTF-8-MAC" -t "UTF-8")

@risou
Copy link
Author

risou commented Oct 18, 2019

I notice a problem of merging this p-r.

This p-r normalizes the input query to NFC.
This causes change characters that should not be changed.
That is CJK compatibility ideographs change to unified ideographs.

For example, が is converted to .
This is an expected conversion.
(The motivation for this p-r.)

But as well, is converted to .
This is an undesirable conversion.

In conclusion, I want to apply the difference in the comment above.
That solution doesn't cause this problem.

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