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

Fred B. fredb7
Tue Oct 12 10:05:56 CDT 2004


On 12-oct.-04, at 17:31, Patrick R. Michaud wrote:

> 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
>

Pm,

I agree this should be solved at the PHP level and not in PmWiki.

I briefly tried to change 'mbstrings'  settings in php.ini, but all i 
could achieve is to suppress all accented chars: Main/T?te was saved as 
Main/Tte and all accented chars were removed from the all wiki too... 
But I didn't spent enough time to seriously explore that. I'll try to 
do it tonight or tomorrow.
I'm new to PHP and I don't even know if I can achieve it with 
mbstring...

Ref. to mbstring: http://www.php.net/mbstring

Thanks.

--
Fred




More information about the pmwiki-users mailing list