views:

67

answers:

1

Hello, Is it a known problem that unregular spaces used in code can cause a CSS or an HTML to be defective ?

When typing a bit fast, I sometimes type ALT+SPACE instead of SPACE (before the curly braces most of the time).

Is it possible to make all alternative spaces symbols (that are invisible to the eyes, but not to the code) be the standard space symbol ?

+2  A: 

You can create your own custom key map, simply by creating a file under ~/Library/KeyBindings, named DefaultKeyBinding.dict. For your purpose the file needs to contain the following lines:

/* ~/Library/KeyBindings/DefaultKeyBinding.dict */

/* My custom Keybinds */
{
    "~ " = ("insertText:", " ");    /* Option + Space = Space */
}

Unfortunately this solution doesn't work for all programs since the bindings are depending on the Cocoa framework and even some of the applications using it do ignore some combinations (more information about the deficits can be found here, under "Caveat").

Additional Links:

  • www.erasetotheleft.com/post/mac-os-x-key-bindings/
  • www.xahlee.org/emacs/osx_keybinding.html
  • www.cocoabits.com/KeyBindingsEditor/Manual/index.html (GUI tool)


About your HTML problem

It actually shouldn't cause any problems to use non-ASCII characters in HTML or CSS but using the wrong character set can lead to unwanted display effects. Without knowing the specific context I can't give any concrete diagnosis about that.

Sorry for the unclickable links but I'm not allowed to submit more than one due to my post number.

Till Theis