Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken after update to MacOS Sonoma (14.0) #16

Open
mario-hab opened this issue Oct 2, 2023 · 8 comments
Open

Broken after update to MacOS Sonoma (14.0) #16

mario-hab opened this issue Oct 2, 2023 · 8 comments

Comments

@mario-hab
Copy link

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:

image
@muffix
Copy link
Contributor

muffix commented Oct 2, 2023

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}')

@michelneeser
Copy link

@muffix This workaround works perfectly, thank you!

@dennis-tra
Copy link
Owner

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

@carstenbauer
Copy link

I've just tested the new release and can confirm that it fixes the issue.

@dahei
Copy link

dahei commented Nov 16, 2023

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.

CleanShot 2023-11-16 at 14 23 13@2x CleanShot 2023-11-16 at 14 23 55@2x

@dennis-tra
Copy link
Owner

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:

image

I'd cut a patch release if this fixes your issue 👍

@dahei
Copy link

dahei commented Nov 20, 2023

I tried that. Now it's not working in either of both os versions. 🤔
CleanShot 2023-11-20 at 15 58 55@2x

@arossmann
Copy link

arossmann commented Jan 16, 2024

I have the same issue and the workaround is not working. Have Sonoma 14.2.1 (23C71) installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants