Open mario-hab opened 1 year ago
Sonoma comes with a newer version of the iconv
tool which has new names for a couple of codesets. UTF8-MAC
, for example, has been renamed to utf-8
. This workflow release calls iconv -f UTF8-MAC <<<'{query}'
before passing the output to the go binary. However, this command errors under Sonoma, which causes an empty string to be passed to the workflow.
❯ iconv -f UTF8-MAC <<< 'test'
iconv: iconv_open(, UTF8-MAC): Invalid argument
❯ iconv -f utf-8 <<< 'test'
test
If you double-click the script filter node of the workflow, you can see the call in the first line. Just change UTF8-MAC
to utf-8
.
@dennis-tra To support both versions, you may want to replace the call with something like this to the node and cut a new release. I'd open a PR, but the info.plist
isn't under version control.
QUERY=$(iconv -f utf-8 <<<'{query}' || iconv -f UTF8-MAC <<<'{query}')
@muffix This workaround works perfectly, thank you!
Thanks to all of you! I just updated the workflow and cut a new release bundling all the latest additions 👍 https://github.com/dennis-tra/alfred-dict.cc-workflow/releases/tag/v2.1.0
Let me know if you encounter anything else
I've just tested the new release and can confirm that it fixes the issue.
I have 2 macs - one with Ventura, the other with Sonoma. The 2.0.0 works on Ventura, but not Sonoma 2.1.0 is the other way around. Works on Sonoma but not Ventura.
Hi @dahei could you try in both of your installations to replace the "Script Filter" with the following snippet and run it?
EXIT_CODE=0
QUERY=$(iconv -f utf-8 <<<'{query}' || EXIT_CODE=$?) # this command can fail
if [ $EXIT_CODE -ne 0 ]; then
QUERY=$(iconv -f UTF8-MAC <<<'{query}')
fi
# Check for Apple Silicon
if [[ $(uname -m) == 'arm64' ]]; then
./dictcc_arm64 "$QUERY"
else
./dictcc_amd64 "$QUERY"
fi
Just double click on the script filter here:
I'd cut a patch release if this fixes your issue :+1:
I tried that. Now it's not working in either of both os versions. 🤔
I have the same issue and the workaround is not working. Have Sonoma 14.2.1 (23C71) installed
The workflow seems to be broken after the update to the latest MacOS version 14.0. No error is shown, yet the translation is not displayed: