Re: [PHP] Hebrew Directory Names

2009-05-29 Thread Nitsan Bin-Nun
Your point is right but these code point does not exist in the subject string so this isn't the issue here. I'm really stuck at this one :S Thank you again for trying to help! On Fri, May 29, 2009 at 2:40 PM, Tom Worster wrote: > On 5/28/09 2:06 PM, "Nitsan Bin-Nun" wrote: > > > preg_replace(

Re: [PHP] Hebrew Directory Names

2009-05-29 Thread Tom Worster
On 5/28/09 2:06 PM, "Nitsan Bin-Nun" wrote: > preg_replace("/([\xE0-\xFA])/e","chr(215).chr(ord(\${1})-80)",$s); ... > The preg_replace() above convert the Hebrew chars into UTF8. that preg_replace takes a byte string $s and: - leaves bytes with value 0-127 intact - converts bytes with value

Re: [PHP] Hebrew Directory Names

2009-05-28 Thread Tom Worster
On 5/28/09 3:21 PM, "Nitsan Bin-Nun" wrote: > That's the thing, I do NOT know the encoding of the GET parameters. in which case that preg_replace is _extremely_ risky. > They are not submitting any form, the request is made through a link ( > tag). if you have control over the pages that incl

Re: [PHP] Hebrew Directory Names

2009-05-28 Thread Nitsan Bin-Nun
On Thu, May 28, 2009 at 8:37 PM, Tom Worster wrote: > On 5/28/09 2:06 PM, "Nitsan Bin-Nun" wrote: > > > i have tried this: > > > > >> > >> $default_locale = setlocale(LC_ALL, 'en_US.UTF-8'); > >> ini_set('default_charset', 'UTF-8' ); > >> > >> > >> $_GET['folder'] = > >> > preg_replace("/([\xE0

Re: [PHP] Hebrew Directory Names

2009-05-28 Thread Tom Worster
On 5/28/09 2:06 PM, "Nitsan Bin-Nun" wrote: > i have tried this: > > > >> $default_locale = setlocale(LC_ALL, 'en_US.UTF-8'); >> ini_set('default_charset', 'UTF-8' ); >> >> >> $_GET['folder'] = >> preg_replace("/([\xE0-\xFA])/e","chr(215).chr(ord(\${1})-80)",$_GET['folder'] >> ); >> >> $dirn

Re: [PHP] Hebrew Directory Names

2009-05-28 Thread Nitsan Bin-Nun
i have tried this: > $default_locale = setlocale(LC_ALL, 'en_US.UTF-8'); > ini_set('default_charset', 'UTF-8' ); > > > $_GET['folder'] = > preg_replace("/([\xE0-\xFA])/e","chr(215).chr(ord(\${1})-80)",$_GET['folder']); > > $dirname = $config['walls_dir'].$_GET['folder']."/".$_GET['filename']; > >

Re: [PHP] Hebrew Directory Names

2009-05-28 Thread Tom Worster
On 5/28/09 1:19 PM, "Tom Worster" wrote: > i suspect there will be serious dependency on os and file system. i was unable to do anything with hebrew file or dir names on freebsd 7.1 with ufs. i even tried scping and tarring over the directory that worked on os x. -- PHP General Mailing List

Re: [PHP] Hebrew Directory Names

2009-05-28 Thread Tom Worster
On 5/28/09 10:15 AM, "Nitsan Bin-Nun" wrote: > I have wrote a files-based php system which not requires any kind of > database to work, it is based upon files and directories. > > I'm using scandir() to fetch the file names of a directory, when the files > and the directories are in English ever

[PHP] Hebrew Directory Names

2009-05-28 Thread Nitsan Bin-Nun
Hi I have wrote a files-based php system which not requires any kind of database to work, it is based upon files and directories. I'm using scandir() to fetch the file names of a directory, when the files and the directories are in English everything works like a charm, the problems starting when