Yii Framework Forum: ^M in yii files - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

^M in yii files Rate Topic: -----

#1 User is offline   Khaoz 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 06-October 08
  • Location:Brazil

Posted 09 October 2008 - 09:02 AM

Some lines (entire file in some cases) in Yii files end with ^M.
I don't know if this can be a problem, but.

Ty.
0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,902
  • Joined: 04-October 08
  • Location:DC, USA

Posted 09 October 2008 - 09:09 AM

This won't be a problem. The only issue is about yiic, which is already fixed.
0

#3 User is offline   Khaoz 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 06-October 08
  • Location:Brazil

Posted 13 October 2008 - 08:37 AM

I know that it's not a problem but there are more file with this carriage return char (ex: framework/validators/).
I'm looking your code and ^M at end of lines hurt my eyes hehehe

This script can help you to do a mass find and replace:

http://codesnippets..../posts/show/965
0

#4 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,902
  • Joined: 04-October 08
  • Location:DC, USA

Posted 13 October 2008 - 09:53 AM

Yeah, that may be a problem for unix/linux users, but you may overcome it by setting your editors.

If we remove those ^M, it would also pose problems for some Windows users. So there is really not perfect solutions here.
0

#5 User is offline   rojaro 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 06-October 08
  • Location:hamburg.de

Posted 13 October 2008 - 03:19 PM

Actually, most windows editors (notepad.exe being the *only* exception i know of) are working just fine with UNIX style newlines, so do ALL editors on Mac and Linux.

It's just that most editors on Mac and Linux show the ^M (aka CRLF), which is useless to PHP anyway and requires one additional byte (or two in UTF-8 encoded files) for every single line of code, whitespace or comment. Also, in most editors, there is no option to just hide the ^M. One usually has to convert the file from DOS to Unix format or has to remove them manually using search and replace.

Today there is not even one single good reason to have the PHP sources in DOS format, unless the majority of developers would use notepad.exe for development or would transfer ASCII files through telnet streams.

Therefore please remove that ^M from all files.

Greetings from Hamburg / Germany
- rojaro -

PS. I do web development development on Windows, Linux and Mac, so on two out of three different systems, this is actually really annoying for me.
0

#6 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,902
  • Joined: 04-October 08
  • Location:DC, USA

Posted 13 October 2008 - 03:34 PM

Ok, i'm convinced. will do it.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users