summaryrefslogtreecommitdiff
path: root/lib/termsupport.zsh
diff options
context:
space:
mode:
authorAndrew Janke <janke@pobox.com>2015-02-21 16:25:28 -0500
committerAndrew Janke <janke@pobox.com>2015-02-21 16:25:28 -0500
commit88f42b6132adedff7557170168416d575569b56e (patch)
tree72aa36912ee51fc5c47bd6f989688b0f1e73217d /lib/termsupport.zsh
parentcb37c934c0e1083897b501e5b8a85340e3b7e470 (diff)
downloadzsh-88f42b6132adedff7557170168416d575569b56e.tar.gz
zsh-88f42b6132adedff7557170168416d575569b56e.tar.bz2
zsh-88f42b6132adedff7557170168416d575569b56e.zip
Add support for variant "utf8" locale suffix spelling. Fix dumb bug in iconv call that would cause it to hang.
Diffstat (limited to 'lib/termsupport.zsh')
-rw-r--r--lib/termsupport.zsh6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index 7cb3791e6..52622f5ab 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -64,12 +64,12 @@ if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
# Returns nonzero if encoding failed
function _omz_urlencode() {
local str=$1
- local url_str=''
+ local url_str=""
# URLs must use UTF-8 encoding; convert if required
local encoding=${LC_CTYPE/*./}
- if [[ -n $encoding && $encoding != UTF-8 ]]; then
- str=$(iconv -f $encoding -t UTF-8)
+ if [[ -n $encoding && $encoding != UTF-8 && $encoding != utf8 ]]; then
+ str=$(echo $str | iconv -f $encoding -t UTF-8)
if [[ $? != 0 ]]; then
echo "Error converting string from $encoding to UTF-8" >&2
return 1