Sunday, July 5, 2009

Double quotes problem in Windows 7

EDIT: Due to big popularity of this post, let me put the solution on top:

If you have a problem with quotes in Windows 7, try to switch the keyboard layout from "United States - International" to "US"
After changing the keyboard layout, you may need to restart your programs or the computer.

ORIGINAL POST:

After installing Windows 7 and Visual Studio 2008, I discovered the following behavior in the code editor:
Pressing the double-quote (") key once would have no effect.
Pressing any key after that would produce both the double quote character and the next character.

The problem was not caused by Visual Studio, but by regional settings - I solved it by switching from "United States - International" to "US" keyboard layout.

57 comments:

  1. Dekuji mockrat, Jaro! Thanks mate! ;-)

    ReplyDelete
  2. Nice one - worked for me too, but only after a reboot

    ReplyDelete
  3. It's nice that someone who knows how to fix a problem just broadcast it.Thank you.

    ReplyDelete
  4. Thx maybe we have to report the problem so microsoft can fix it ??

    ReplyDelete
  5. There is nothing to fix, this is by design.

    ReplyDelete
  6. Don't forget to restart Visual Studio after you change the layout!

    ReplyDelete
  7. This is really helpful! As a coder, this is really a must do if you got problems with quotes. Anyway, you should add in this brief fix that everyone who tries this fix with no results should do a restart and then check it out. Because I'm sure there are many who encountered this problem and had to restart first.

    Just a suggestion :)

    ReplyDelete
  8. After years of doing two unnessesary inputs (pressing double-quote twice, and correct the second one with backspace) i finally found the solution by my self, using the very same method. God, i was SO happy that i could normally type the double-quote ONCE to make it appear! :-)

    Hopefully this blog article will help many others in-time! Thank you for sharing this with the world ;-)

    Best regards (from the Netherlands),
    copy[it]right

    ReplyDelete
  9. Thanks a lot. That quotes' behavior was very irritating.

    ReplyDelete
  10. this is definitely a bug, not a feature :D

    ReplyDelete
  11. Thanks a lot, this stopped me from cracking my head open by banging it against the wall for several hours.

    ReplyDelete
  12. 1) The same is in WinXP as well as in Win7.
    2) Does for simple quotes '' as well as for double "".
    3) "nothing to fix, this is by design" - very strange "feature".
    4) Exactly as described:
    "United States - International" requires double press,
    on the other hand, the "English - US" keyboard types a character on each keypress.
    5) I had 2 keyboards (en+cs) installed already, so the change took effect immediately:
    Win restart not needed for me. (this probably can vary/depend)
    6) During thet changing, I had 2 layouts for the en keyboard in the same time.
    There appeared additional icon in the "Win main bar": The "EN" icon + a "keyboard" icon,
    to change layouts of the same EN keyboard.
    7) To be able to remove (unselect/diable) the present "EN-international" layout,
    you need to set some other keyboard/layout as a "default", before.

    Good luck to every one!

    Thank you Jaroslave!

    ReplyDelete
  13. Thanks a lot!
    Anyway, I think this is a "workaround" rather than a "solution".
    Does anybody know why it behaves that way with the US-International layout?

    ReplyDelete
  14. in us international if you press the double quotes and then a vowel, it produces ö,ä,ü.. if you press quotes and then a non vowel, it just gives you the quotes + the letter you pressed, eg. "p

    so international is basically if you need to produce funny characters. it is too bad this has to be done at the expense of not having proper double quotes. i think if they could work around that, us-international would have been the best standard. but since they haven't you have to stick to simple US.

    ReplyDelete
  15. To clarify for those who do not yet understand this behavior: US International is a keyboard setting meant for English-language using people who also frequently have to type the accented characters of various Western European languages (as well as «guillemots», etc). This is achieved by through dead keys, which are used to compose secondary characters. The most common dead keys are " ^ ' ` and ~, corresponding to umlaut (diaeresis), circumflex, acute accent, grave accent and tilde. All of the deadkeys can also be used to produce their ordinary values by pressing a space after. For those of us who use this keyboard layout on purpose, this is second nature. If you've selected this keyboard layout and didn't know what deadkeys are, you should choose a standard English layout; but it's not a bug, its the foundational concept of an international keyboard (it's also not specific to Windows).

    ReplyDelete
  16. many thanks. That is what I am looking for :)

    ReplyDelete
  17. The fix works for the " key, but now the Euro sign key (AltGr + 5) stopped working. Is there a keyboard layout (preferably English-US) that allows for single action "-key behavior along with a working €-sign on the 5-key?

    ReplyDelete
  18. Thanks, dude ;) Double quotes were really annoying thing :)

    ReplyDelete
  19. "Děkuji Jaroslave!" Big mystery solved.

    ReplyDelete
  20. I though that it was a notepad++ thing since I experienced it only there. Anyway thanks! ... It was getting annoying (I had to write 1000 lines of code with that bug just because I was lazy enough to look around google ....)

    ReplyDelete
  21. Thanks! very helpful

    ReplyDelete
  22. Thanks!
    Shame on M$ for their "hidden-not-asked-useless-features"

    ReplyDelete
  23. Dakujem velmi pekne! Velmi uzitocna informacia! Este raz vdaka!

    ReplyDelete
  24. Thank you to commenter toop for explaining how to work around this for those who want to *keep* the United States - International keyboard layout. To create a double quote, press the " key (shift + '), followed by a space.

    ReplyDelete
  25. Thanks so much mate. This was pestering me quite a bit and glad to find a solution finally. Cheers.

    ReplyDelete
  26. Awesome...
    Thanx..It was really helpful

    ReplyDelete
  27. Thnks, that really worked, don't forget to restart your programs

    ReplyDelete
  28. No restart needed, takes effect immediately.

    ReplyDelete