Skip to main content

All Questions

Tagged with
0 votes
1 answer
777 views

How do I write the £ (GBP) sign in a CSV file from Ruby and read it back correctly in Excel?

When I write a CSV file using Ruby containing the £ sign and I open it using Excel I see this symbol instead ¬£. My understanding is that Ruby uses UTF-8, but Excel interprets this file using a ...
mottalrd's user avatar
  • 4,490
0 votes
0 answers
165 views

rspec test failures with present to non-English symbols

I'm comparing multiple files containing russian characters, and that's a result of getting. I replaced the symbols and the tests were properly My environments: Rails 5.0.0.1 and ruby 2.3.1p112 (2016-...
Takamura's user avatar
  • 312
2 votes
1 answer
3k views

python equivalent of ruby's ASCII-8BIT encoding scheme

I need to encoding something in ASCII-8BIT because it's part of the specification of the program. The demo code is written in ruby and they have used Encoding::BINARY which is equivalent to ASCII-...
mega-crazy's user avatar
0 votes
0 answers
224 views

Ruby File Encoding Issues while Streaming

I am using RestClient to stream some files from websites and am running into encoding issues when I write to disk. I'm following this example: File.open('/path/to/text/file.txt', 'w') {|f| block ...
j will's user avatar
  • 3,827
1 vote
1 answer
301 views

ASCII Space Character in Ruby Unicode Escape

Doing some reading and came across this block of code on the topic of Unicode Escapes in Ruby: money = "\u{20AC 20 A3 20 A5}" # => "€ £ ¥" I understand that in this ruby syntax, the actual spaces ...
inthenameofmusik's user avatar
1 vote
1 answer
964 views

Encoding::UndefinedConversionError: "\x8C" from ASCII-8BIT to UTF-8

I know this question is asked many times. But unfortunately I did not get any solution at such question. My problem is when I do rails s, I am getting the below error. Can anyone suggest me what is ...
PythonDev's user avatar
  • 4,317
1 vote
1 answer
53 views

How to convert Haryāna to Haryana with Ruby

I am getting this value from an api and somehow it is sending some special unicode chars in the value. I would like to convert this into a normal ascii string.
whizcreed's user avatar
  • 2,782
5 votes
1 answer
1k views

Reading ASCII-encoded files with Ruby 1.9 in a UTF-8 environment

I just upgraded from Ruby 1.8 to 1.9, and most of my text processing scripts now fail with the error invalid byte sequence in UTF-8. I need to either strip out the invalid characters or specify that ...
Doches's user avatar
  • 3,498
3 votes
6 answers
7k views

"Invalid multibyte char (US-ASCII)" error for ä, ü, ö, ß which are Ascii!

My application needs to handle some international characters, namely ä, ü, ö and ß, which are still ascii. When I tested the behavior of ruby when dealing with these chars, I got this error: test.rb:...
Vincent's user avatar
  • 4,056