[Developers] [Slim-Checkins] r15177 - /trunk/server/Slim/Utils/Strings.pm
Phil Meyer
slim at hergest.demon.co.uk
Thu Dec 13 01:19:38 PST 2007
>[\r\n] doesn't mean a CR/LF pair. [ ] in a perl regex means "any of the characters listed".
I'm fully aware of regex's, not so much perl!
>The string $text is split on '\n' and $line is set to each fragment in
>turn. So, $text can never contain "\n".
>
That was the point I was kind of trying to make - that a lines must have already been split by some form of end-of-line marker.
>One further point of pedantry - if the original strings.txt files were
>created on Mac Classic machines, they could have \r line endings, in
>which case the split(...) would not work at all. Do we need to code
>round that possibility?
>
There could be a posibility of files having a mixture of \r, \n, \r\n or \n\r line endings. I've seen this happen when files have been ftp'd across various OS's.
Would it not be possible to split on either \n or \r, and then ignore empty strings for the case when \r and \n appeared together.
Phil
More information about the developers
mailing list