> > - if Darwin has a configurable locale, does *not* set this up by
> > default
> > such that nl_langinfo(CODESET) returns UTF-8, but does by policy
> > require
> > filenames in UTF-8, regardless of locale, I would agree with changing
> > apr_filepath_encoding as Erik proposed.  That is the case?
>
>    I don't know what the BSD locale system (nl_langinfo , whatever)
> does in Darwin; I've never worked with it.  I only know that for file
> names, we tell developers to use UTF-8.
>
>         -wsv

I'd like to conclude this thread then by supplying a patch which
applies equally to trunk and 0.9.x with patch -p1, to return UTF8
paths on Darwin.

Note that I wasn't able to test the change myself, as I don't have
access to Darwin, but the code change is trivial. (I just wonder if I
got the #if-s right.)

Bye,

Erik.

(I attached the patch because Google often munges them, but if you
want, I can supply it inline too.)
Index: trunk/file_io/unix/filepath.c
===================================================================
--- trunk/file_io/unix/filepath.c	(revision 562753)
+++ trunk/file_io/unix/filepath.c	(working copy)
@@ -305,6 +305,10 @@
 
 APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p)
 {
+#if defined(DARWIN)
+    *style = APR_FILEPATH_ENCODING_UTF8
+#else
     *style = APR_FILEPATH_ENCODING_LOCALE;
+#endif
     return APR_SUCCESS;
 }

Reply via email to