Skip to content

Commit

Permalink
eclipse installer uses jq instead of native2ascii
Browse files Browse the repository at this point in the history
Another uncontrolled deprecation (read: abrupt removal) of a JDK feature worked around.
  • Loading branch information
wipu committed Apr 4, 2024
1 parent dbe476e commit b0d0e6f
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,23 @@ downloaded-tool() {

native-path-ascii() {
local IN=$1
native-path "$1" | native2ascii
local N=$(native-path "$IN")
to-ascii "$N"
}

# JDK dropped native2ascii so we have to use jq for
# converting special chars (like scandinavian letters) to
# the \uXXXX format
to-ascii() {
local IN=$1
to-json-array "$IN" |
jq -ac |
sed 's/^\["//' | sed 's/"]$//'
}

to-json-array() {
local IN=$1
echo '["'$IN'"]'
}

native-path() {
Expand Down

0 comments on commit b0d0e6f

Please sign in to comment.