Workaround FUSE missing the generally broken Linux kernel charset support.
[captive.git] / src / client / fuse / op_truncate.c
index c8f5946..b71b061 100644 (file)
@@ -29,6 +29,7 @@
 #include "op_truncate.h"       /* self */
 #include "main.h"
 #include "gnomevfsresult.h"
+#include "utf8.h"
 
 
 int op_truncate(const char *path,off_t size)
@@ -39,6 +40,8 @@ GnomeVFSResult errvfsresult;
        g_return_val_if_fail(path!=NULL,-EINVAL);
        g_return_val_if_fail(size>=0,-EINVAL);
 
+  path=CAPFUSE_FILENAME_TO_UTF8_ALLOCA(path);
+
        if (GNOME_VFS_OK!=(errvfsresult=captive_file_new_open(&captive_file_object,capfuse_captive_vfs_object,path,
                        GNOME_VFS_OPEN_WRITE|GNOME_VFS_OPEN_RANDOM)))
                return -gnomevfsresult_to_errno(errvfsresult);