forgetfulfellow Posted April 29, 2014 Share Posted April 29, 2014 Hi, I was wondering if anyone had any experience in the area of non-latin characters in Alfred, specifically Korean. So when I put in 려 into the terminal and feed it into a python program like python script.py 려 I print out the unicode of the character and get: 려 == '\xeb\xa0\xa4' Yet when I put 려 into Alfred with the query variable: python script.py "{query}" I get: ᄅ ᅧ == '\xe1\x84\x85\xe1\x85\xa7' This second output is actually two characters, or the two characters that make up the single character. Does anyone know how I can force Alfred to return the first version of the character? Link to comment
jmjeong Posted April 29, 2014 Share Posted April 29, 2014 Hi, I was wondering if anyone had any experience in the area of non-latin characters in Alfred, specifically Korean. So when I put in 려 into the terminal and feed it into a python program like python script.py 려 I print out the unicode of the character and get: 려 == '\xeb\xa0\xa4' Yet when I put 려 into Alfred with the query variable: python script.py "{query}" I get: ᄅ ᅧ == '\xe1\x84\x85\xe1\x85\xa7' This second output is actually two characters, or the two characters that make up the single character. Does anyone know how I can force Alfred to return the first version of the character? Refer http://jmjeong.com/unicode-in-alfred-workflow/ forgetfulfellow 1 Link to comment
forgetfulfellow Posted April 30, 2014 Author Share Posted April 30, 2014 Refer http://jmjeong.com/unicode-in-alfred-workflow/ AWESOME! Thanks so much, this basically solved my problem Link to comment
Peter VandeHaar Posted September 4, 2015 Share Posted September 4, 2015 Thanks! This was a problem for me as well. Link to comment
deanishe Posted September 5, 2015 Share Posted September 5, 2015 (edited) Yeah, the fundamental problem is that Python uses NFC-normalised Unicode by default, while OS X uses an NFD-ish form by default. If you're writing workflows in Python, you can try my Alfred-Workflow library, which normalises all input to a common format by default. The default is NFC, but you can easily change that to NFD or any other form. There's a more detailed description of the issue in the documentation. Edited September 5, 2015 by deanishe 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