Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Ruby Basics (Retired) Ruby Strings Whitespace

Rob Brown
Rob Brown
3,986 Points

Can't type a "\" in ruby basics workspaces.

I'm using windows, when trying to add \n to a string all i get is currency symbol and i can't get a back slash with any other key combo.

name = "Rob" string = "hello \nmy name is #{name} this isn't working!" puts string

has anyone else had this problem?

thanks

Rob

4 Answers

Jim Hoskins
STAFF
Jim Hoskins
Treehouse Guest Teacher

So, it is ¥. I saw this before a long time ago, though the exact solution escapes me. Your computer(s) definitely have a setting that has some sort of Japanese support turned on. Evidently (from some Google searching) Windows does some tricky things with some Japanese settings that involves the \ and ¥ characters and swapping unicode glyphs on your computer.

Check out Start -> Control Panel -> Clock, Language, and Region -> Region and Language and go through all the tabs and see if anything looks unusual.

If you can't find anything there, I'd suggest looking around at other people having such an issue, and what they might have done to solve it. Here's a Google search to get you started.

Rob Brown
Rob Brown
3,986 Points

Thanks Jim, I'll have a look and see what I can come up with.

Yep, I have this issue , too. Not too big a deal with small scripts because it still does what it's supposed to do.

Jim Hoskins
STAFF
Jim Hoskins
Treehouse Guest Teacher

That sounds pretty unusual. I think I've heard of this problem before, and it tends to be keyboard settings on the computer that are the fix. A few questions that could help find a solution:

  • Does it happen in notepad or any other programs, or just in workspaces? Is it in the workspaces editor, console, or both?
  • Which "currency symbol" does it print? $, £, ¥, or something different?
  • What keyboard layout are you using? What region or language is it?

1) Just the workspace editor 2) Yen symbol 3) Standard US qwerty

Rob Brown
Rob Brown
3,986 Points

Hi Jim, it's just Workspaces. the symbol is ¥ and the keyboard is standard English (UK) layout.

Thanks

Rob