Jump to content

Korean Input Is different in Alfred vs. Terminal


Recommended Posts

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

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/

Link to comment
  • 1 year later...

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 by deanishe
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...