mkasu Posted October 8, 2015 Share Posted October 8, 2015 Hey, I've had some trouble with my workflows. When using umlauts and/or Asian characters, my scripts crash due to some weird encoding issues I think. I found some solutions and discussions to this: http://www.alfredforum.com/topic/1907-bash-script-in-workflow-language-of-locals-accented-characters/ http://www.alfredforum.com/topic/2015-encoding-issue/ However, I could not fully resolve my issues. I have a workflow Script filter with a /bin/bash script: QUERY=$(./normalise "{query}") /usr/bin/ruby ./main.rb $QUERY When using latin alphabet, it works and my ruby script is called successfully. However, when using any special characters, it crashes and Alfred falls back to the Google/Wikipedia default search thingy. The debug mode shows: [ERROR: alfred.workflow.input.scriptfilter] Code 255: Exited with error code but no message Any clues? I also tried a solution with iconv. I also couldn't get it running that way. Furthermore, I'd like to keep special characters as they are, as I'd like to parse Asian texts into my script. When running in Terminal, my script works as intended. Regards, Marc Link to comment
deanishe Posted October 9, 2015 Share Posted October 9, 2015 Have you tried explicitly specifying an encoding? Either add this to the top of your bash script: export LC_CTYPE=en_US.UTF-8 Or call ruby with -Ku (use UTF-8). Can't say more without the actual code and input that's causing the error. Link to comment
mkasu Posted October 9, 2015 Author Share Posted October 9, 2015 Cheers. Thanks, -Ku did the trick. Actually I was lacking knowledge regarding Ruby, because I never used this programming language before, so I didn't know you need to "force" UTF input. I'm just fixing bugs in abandoned some workflows for my purposes . Good to know. Regards, Marc Link to comment
deanishe Posted October 9, 2015 Share Posted October 9, 2015 I got that trick from one of the threads you linked to. I just knew it was related to Alfred not specifying a UTF-8 environment. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now