Skip to content

Commit

Permalink
Revert "Implement binread (mimic ASCII-8BIT encoding) (#1824)"
Browse files Browse the repository at this point in the history
This reverts commit a7124ee.
  • Loading branch information
iliabylich committed May 15, 2018
1 parent a7124ee commit f9e50a9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion stdlib/nodejs/io.rb
Expand Up @@ -36,7 +36,7 @@ def self.read(path)
end

def self.binread(path)
`return executeIOAction(function(){return __fs__.readFileSync(#{path}).toString('utf-8')})`
`return executeIOAction(function(){return __fs__.readFileSync(#{path}).toString('binary')})`
end
end

Expand Down
6 changes: 0 additions & 6 deletions test/nodejs/test_io.rb
Expand Up @@ -15,10 +15,4 @@ def test_binread_noexistent_should_raise_io_error
IO.binread('tmp/nonexistent')
end
end

def test_binread_encoding
File.write('tmp/foo', 'Le français c\'est compliqué :)\n')
assert_equal("Le fran\xC3\xA7ais c'est compliqu\xC3\xA9 :)\\n", IO.binread('tmp/foo'))
assert_equal("Le français c'est compliqué :)\\n", IO.binread('tmp/foo'))
end
end

0 comments on commit f9e50a9

Please sign in to comment.