Re: Re: Different OS, Different Line Break, Be a Little Problem
| From: | Helgi Þormar | Date: | Fri, 21 Jan 2005 18:55:01 +0000 |
| Subject: | Re: Re: Different OS, Different Line Break, Be a Little Problem | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-35673@lists.php.net to get a copy of this message | ||
On Fri, 2005-01-21 at 18:43, Firman Wandayandi wrote:
> Torsten Roehr wrote:
>
> >"Firman Wandayandi" <orangenigma@gmail.com> wrote in message
> >news:<41F0FCD9.1030604@gmail.com>...
> >
> >
> >>Hi guys,
> >>
> >>I has a little problem with line break character, when i developing
> >>Contact_AddressBook, I tried to using different format of file,
> >>actually I used Windows (CRLF), Unix (LF) and Mac (CR).
> >>Contact_AddressBook use File_CSV (PEAR::File Package) to handling CSV
> >>file, when I sets the config 'crlf' = "\r\n" then I given Windows
> >>and
> >>Unix file format, everything fine, but when i given Mac format it
> >>doesn't working.
> >>
> >>PEAR.php, only defined OS_WINDOWS and OS_UNIX also PEAR_OS which the
> >>value is one of 'Windows' or 'Unix', I think, I able to resolve
> >>this
> >>problem if I know what the OS.
> >>
> >>My questions:
> >>1. How to know what the OS, Windows/Unix/Mac family? Actually the
> >>problem is Mac, cause I can't testing there, I have no Mac OS :-D
> >>installed.
> >>2. Does it needed to define OS_MAC and PEAR_OS = 'Mac' in PEAR.php?
> >>
> >>Regards,
> >>-- Firman
> >>
> >>
> >
> >>From PHP 5.0.3 there is the constant PHP_EOL that contains the OS-dependant
> >linebreak.
> >Maybe this helps.
> >
> >Best regards, Torsten Roehr
> >
> >
> >
> >
> That's maybe help, but I want it's working on PHP4 too.
Either do what Justin and Daniel said or use PHP_Compat, it has support
for PHP_EOL :-)
- Helgi