giangvo / alfred-workflow-nodejs

A small library providing helpers to create Alfred Workflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Encoding issue

krokofant opened this issue · comments

I have a menu which first gets a list of objects from online. These objects contains strings with ä in them. These are encoded as %E4. The problem seems to arise when I select an element from a menu. The menu element has an ä which has the hex value %E4. When I autocomplete the title gets sent to an onMenuItemSelected listener.

The title is now still an ä but has a hexencoding of a%u0308 which makes the following code fail:

function getItemData(itemTitle) { var wfData = Storage.get("wfData"); return wfData ? wfData[itemTitle] : undefined; }

The wfData has a key containing the %E4 based ä and the ä in itemTitle is based on a%u0308.

Any idea on how to solve this?