[list] Re: [Pmwiki-users] Few questions.

Patrick R. Michaud pmichaud
Tue Oct 12 09:31:09 CDT 2004


On Tue, Oct 12, 2004 at 02:03:27AM +0200, Fred B. wrote:
> >On Thu, Oct 07, 2004 at 05:03:51AM +0200, Fred B. wrote:
> >>So, now, I'm using PmWiki 2.0Devel11 on Mac OS X Server 10.3.5,
> >>Apache/1.3.29 and PHP/4.3.2
> >>[...]
> >>I can't use accented letters in WikiLinks, when I try to save a page
> >>with a name including accent (?,?,?,...) I get:
> >>"Warning: fopen(wiki.d/Main.T?te,new): failed to open stream: Invalid
> >>argument in /pmwiki/pmwiki.php on line 426
>
> And here is what's in the log:
> "[error] PHP Warning:  fopen(wiki.d/Main.T?te,new) [<a 
> href='function.fopen'>function.fopen</a>]: failed to open stream: 
> Invalid argument in /Library/WebServer/Documents/pmwiki/pmwiki.php on 
> line 426"
> (Looks the '?' is not recognized properly.)
> 
> I don't see how it could be related to OS X. Maybe I should enable 
> something in php.ini? I still search about it. All clues are welcome.

I searched a bit further this morning and it looks like the "problem"
is indeed related to OS X.  Apparently the HFS+ filesystem that
OS X uses to store files doesn't accept Latin-1 characters in filenames;
they have to be converted into decomposed UTF-8 character sequences, 
thus '?' (0x00e9) has to be represented in the filename as 'e' (0x0065)
followed by '?' (0x0301).  

I have no idea how PHP handles this--one would expect that it (or
the libraries it uses) would handle such issues on behalf of the
application, but given the error message we're seeing I'm guessing
it doesn't do that.

So, I'm not exactly sure how to "fix" this.  One solution might be to
provide an option for PmWiki to try to UTF-8 encode/decode all 
filenames passed to/from the OS, but somehow that feels wrong.  Another
might be to simply strip accents from filenames (they would remain in
the page names, of course).  Still another is to develop a database-backed
storage engine for storing pages.  None of these are particularly appealing
prospects at the moment, though.  :-(

Pm



More information about the pmwiki-users mailing list