Permalink
Browse files

Convert Unicode NFD to NFC in non-ASCII query strings

Normalize Unicode representation of query chars with diacritics to
default UTF-8 (NFC). Fixes #2
  • Loading branch information...
1 parent 4b81d50 commit 396b2950b8e68aec3fe56e5905e73e134dcb4519 @kopischke committed Apr 3, 2013
Showing with 10 additions and 6 deletions.
  1. +1 −2 README.md
  2. +6 −1 src/numbers
  3. +1 −1 src/update.json
  4. +2 −2 versions.json
View
@@ -38,8 +38,7 @@ Dial with PushDialer supports [Alleyoop][alleyoop] for automated updates. [Insta
## Known bugs
-* If you miss mobile numbers in feedback, make sure the phone label in the Contacts application is not set to “iPhone” – that label is not recognized by the utility used to query the Contacts store \[[Issue #1](../../issues/1)\].
-* Alfred version 2.0.2 seems not to pass query parameters containing non-ASCII characters correctly to script filters. The `call` filters will not match such queries until this is resolved \[[Issue #2](../../issues/2)\].
+1. If you miss mobile numbers in feedback, make sure the phone label in the Contacts application is not set to “iPhone” – that label is not recognized by the utility used to query the Contacts store \[[Issue #1](../../issues/1)\].
## Credits and License
View
@@ -1,7 +1,12 @@
#!/usr/bin/env bash
scriptdir="${0%/*}"
-query=($1)
+# normalize Unicode representation of characters with diacritics
+not_ascii='[^ -~]'
+[[ "$1" =~ $not_ascii ]] && query="$(echo "$1" | iconv -s -f 'UTF-8-Mac' -t 'UTF-8')" || query="$1"
+
+# assign arguments
+query=($query)
desc="${2:-main phone number}"
code="${3:-%p}"
icon="${4:-vCard.png}"
View
@@ -1,4 +1,4 @@
{
- "version": 1.01,
+ "version": 1.02,
"remote_json": "https://github.com/kopischke/alfred-pushdial/raw/master/versions.json"
}
View
@@ -1,5 +1,5 @@
{
- "version": 1.01,
+ "version": 1.02,
"download_uri": "https://github.com/kopischke/alfred-pushdial/raw/master/Dial%20with%20PushDialer.alfredworkflow",
- "description": "Now processes “$” and “`” characters in queries correctly."
+ "description": "Queries with non-ASCII characters now work in call commands."
}

0 comments on commit 396b295

Please sign in to comment.