Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Locale Setting Help
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
jeffrey1790
n00b
n00b


Joined: 11 May 2011
Posts: 2

PostPosted: Wed May 11, 2011 3:32 am    Post subject: Locale Setting Help Reply with quote

When I open any file that was created in windows, i get ^M appended to every single line. My default locale is utf_8, ive also tried iso-8859-1, but still have the same problem.
My /etc/locale.gen
Code:

en_US.UTF-8 UTF-8
en_US.ISO-8859-1 ISO-8859-1


I dont want to convert everyfile made in windows.

If anyone can help me fix this, that would be much appreciated.
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Wed May 11, 2011 8:12 am    Post subject: Reply with quote

Windows and Linux/UNIX systems (and older Macs for that matter) have different newline characters. See this wikipedia article about it.

The ^M is the extra carriage return that is part of the Windows newline character.

There's not much you can do to 'fix' the problem if you're e.g. sharing a drive between both OSes.

If you do want to convert between the two you should install app-text/dos2unix which will give you the dos2unix and unix2dos commands (as well as ones for converting between Mac and UNIX format).
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
jeffrey1790
n00b
n00b


Joined: 11 May 2011
Posts: 2

PostPosted: Wed May 11, 2011 3:14 pm    Post subject: Reply with quote

tomk wrote:
Windows and Linux/UNIX systems (and older Macs for that matter) have different newline characters. See this wikipedia article about it.

The ^M is the extra carriage return that is part of the Windows newline character.

There's not much you can do to 'fix' the problem if you're e.g. sharing a drive between both OSes.

If you do want to convert between the two you should install app-text/dos2unix which will give you the dos2unix and unix2dos commands (as well as ones for converting between Mac and UNIX format).


After converting all the windows text files, I have noticed that an .ini file autogenerated by a linux game added the ^M to the end of each line. Since theres a ^M on each line, the game fails to read the preferences.
EDIT: Its just nano that seems to be the issue.
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Thu May 12, 2011 8:00 am    Post subject: Reply with quote

jeffrey1790 wrote:
EDIT: Its just nano that seems to be the issue.

I don't use nano but it this option might be what you are looking for:

man nano wrote:
-N (--noconvert)
Disable automatic conversion of files from DOS/Mac format.


Or the equivalent for nanorc:
man nanorc wrote:
set/unset noconvert
Don't convert files from DOS/Mac format.

_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum