# File.read not working properly for .txt file

**URL:** <https://www.ruby-forum.com/t/file-read-not-working-properly-for-txt-file/188188>\
**Category:** Rails\
**Created:** [May 7, 2010, 7:19am UTC](https://www.ruby-forum.com/t/file-read-not-working-properly-for-txt-file/188188 "2010-05-07T07:19:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anubhaw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4491bb/32.png) [@anubhaw](https://www.ruby-forum.com/u/anubhaw)\
**Post date:** [May 7, 2010, 7:19am UTC](https://www.ruby-forum.com/t/file-read-not-working-properly-for-txt-file/188188/1 "2010-05-07T07:19:29Z")

</div>

Hi All,  
I am trying to read a .txt file through File.read method. It returns  
value ‘0004\0004\0007\0005\0005\0000\0001\0002\0001\000\t\000A\000u’.  
But when i open the file and save it as save as it returns value for  
example ‘\t21554005\abcd\xy\zzz’ which is proper. I am using fedora-11  
machine. The file properties or permissions does not change.  
Can any one point out what can be the error.

Thanks in advance,  
Anubhaw
