chieffancypants / angular-hotkeys

Configuration-centric keyboard shortcuts for your Angular apps.
http://chieffancypants.github.io/angular-hotkeys/
MIT License
1.68k stars 248 forks source link

Symbols in cheat sheet are broken #179

Closed richtmat closed 9 years ago

richtmat commented 9 years ago

Some symbols representing keys like 'up', 'down', etc are broken in my Linux/Electron app.

screenshot from 2015-09-21 17 51 17

Do I need to include anything beside hotkeys.css/js ?

chieffancypants commented 9 years ago

Hmm, nope, it's just using unicode for those characters.

richtmat commented 9 years ago

So what is possibly wrong here? I can display those characters anywhere else on the app and its fine.

chieffancypants commented 9 years ago

Really hard for me to say without access to the project you're working on. There are too many situations where this could have been broken downstream of the provided built files. For example, did you build hotkeys yourself or attempt to minify it or otherwise process it in a way that could strip the unicode? Perhaps the file was not (at one point or another) stored in UTF-8 format?

Another thing you could try would be replacing the actual unicode characters (such as ⌘) with their escape sequences (⌘ becomes \u2318) in the source, which may prevent inadvertent downstream tampering.

richtmat commented 9 years ago

I get via bower and include the hotkeys.css/.js unminified. The app is unminified as well.

The escaped sequence works for me! That is ok as a workaround but I would like to solve that properly.

The file is encoded in UTF-8 though:

$ file bower_components/angular-hotkeys/build/hotkeys.js bower_components/angular-hotkeys/build/hotkeys.js: HTML document, UTF-8 Unicode text

chieffancypants commented 9 years ago

If you want to submit a PR, I'm ok with using escape sequences as long as those escape sequences contain comments with the actual unicode (to avoid having to look things up later).

richtmat commented 9 years ago

There it is: https://github.com/chieffancypants/angular-hotkeys/pull/181