0

My code editor gets rid of _ when I type Japanese characters in between " " in yaml.

I use AWS cloud9 to write codes.

For example, when I type

current_password: "現在のパスワード"</p>

this is displayed as current password: "現在のパスワード" in the editor.

_ is missing in the key, so this gets a syntax error when I load this file.

However, when the quotation marks don't include Japanese characters, _ is visible in the editor.

current_password: "aaa"

In case of no string in the quotation marks,

current_password: ""

it gets the same result(_ is properly shown).

Is there any way to cope with this editor problem? Or is there a way to handle non-English characters as string in yaml file?

Anthon
  • 69,918
  • 32
  • 186
  • 246
Kouta Nakano
  • 595
  • 3
  • 15
  • Have you tried to provice `current_password` as a quoted scalar instead of a plain scalar (i.e. surround by single (`'`) or double (`"`) quotes? That makes no difference for key the YAML parser loads, but maybe prevents the underscore from disappearing in the editor. – Anthon Sep 27 '18 at 11:25
  • This certainly is an editor problem, since all Unicode characters apart from YAML's special characters are to be simply treated as content according to the YAML spec. Keep in mind that while you might find a workaround, the proper way to handle this is to file a bug against the editor. – flyx Sep 28 '18 at 11:14
  • - Anthon I tried single quotes and double quotes too. – Kouta Nakano Oct 02 '18 at 03:50
  • -flyx Actuallly, the editor just didn't show the underline between current_password but the file treated it as including _. So, I guess it's okay :P It was just confusing how it was displayed as current(space)password. And when I was trying to fix it I got the syntax error somehow... I was really tired i guess. Thank you guys! – Kouta Nakano Oct 02 '18 at 03:53

0 Answers0