diff options
| author | Tuowen Zhao <ztuowen@gmail.com> | 2023-12-09 13:20:13 -0800 |
|---|---|---|
| committer | Tuowen Zhao <ztuowen@gmail.com> | 2023-12-09 13:20:13 -0800 |
| commit | 7e951c254e779ff0620537cf43ca69dd878387b4 (patch) | |
| tree | cb042e695bb3e11ed0483fad1af8a5b4f1bfc8d8 /lib/functions.zsh | |
| parent | 4d908094fdc2a0c0e9a0a072eba213fab7adef43 (diff) | |
| parent | 48ccc7b36de8efb2bd7beb9bd6e0a6f6fe03b95d (diff) | |
| download | zsh-7e951c254e779ff0620537cf43ca69dd878387b4.tar.gz zsh-7e951c254e779ff0620537cf43ca69dd878387b4.tar.bz2 zsh-7e951c254e779ff0620537cf43ca69dd878387b4.zip | |
Merge remote-tracking branch 'github/master'
Diffstat (limited to 'lib/functions.zsh')
| -rw-r--r-- | lib/functions.zsh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/functions.zsh b/lib/functions.zsh index a252d0a33..f5c671f9c 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -182,6 +182,8 @@ function omz_urlencode() { fi # Use LC_CTYPE=C to process text byte-by-byte + # Note that this doesn't work in Termux, as it only has UTF-8 locale. + # Characters will be processed as UTF-8, which is fine for URLs. local i byte ord LC_ALL=C export LC_ALL local reserved=';/?:@&=+$,' @@ -206,6 +208,9 @@ function omz_urlencode() { else if [[ "$byte" == " " && -n $spaces_as_plus ]]; then url_str+="+" + elif [[ "$PREFIX" = *com.termux* ]]; then + # Termux does not have non-UTF8 locales, so just send the UTF-8 character directly + url_str+="$byte" else ord=$(( [##16] #byte )) url_str+="%$ord" |
