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 62a31e684fd47803741105b224462cd09dd15db3 @kopischke committed Apr 3, 2013
Showing with 9 additions and 4 deletions.
  1. +6 −1 src/numbers
  2. +1 −1 src/update.json
  3. +2 −2 versions.json
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 62a31e6

Please sign in to comment.