Jump to content

Issues with workflows and foreign characters


Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...