summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/file.c b/file.c
index ceed58d774..cfa10ae67d 100644
--- a/file.c
+++ b/file.c
@@ -240,6 +240,19 @@ rb_str_encode_ospath(VALUE path)
return path;
}
+#ifdef __APPLE__
+VALUE
+rb_str_normalize_ospath(const char *ptr, long len)
+{
+ rb_encoding *utf8mac = rb_enc_from_index(ENCINDEX_UTF8_MAC);
+ if (utf8mac) {
+ return rb_str_conv_enc(rb_tainted_str_new(ptr, len),
+ utf8mac, rb_utf8_encoding());
+ }
+ return Qnil;
+}
+#endif
+
static long
apply2files(void (*func)(const char *, VALUE, void *), VALUE vargs, void *arg)
{