Index: uspace/srv/fs/fat/fat_dentry.c
===================================================================
--- uspace/srv/fs/fat/fat_dentry.c	(revision 4372b49b76fe110218c2e4d58757d8b1815ecf84)
+++ uspace/srv/fs/fat/fat_dentry.c	(revision 9553d7d87cd577b119b96a55a3bfb106c2d072e8)
@@ -361,4 +361,37 @@
 }
 
+/** Convert string to utf16 string.
+ *
+ * Convert string @a src to wide string. The output is written to the
+ * buffer specified by @a dest and @a dlen. @a dlen must be non-zero
+ * and the wide string written will always be null-terminated.
+ *
+ * @param dest	Destination buffer.
+ * @param dlen	Length of destination buffer (number of wchars).
+ * @param src	Source string.
+ */
+int str_to_utf16(uint16_t *dest, size_t dlen, const char *src)
+{
+	size_t offset;
+	size_t di;
+	uint16_t c;
+
+	assert(dlen > 0);
+
+	offset = 0;
+	di = 0;
+
+	do {
+		if (di >= dlen - 1)
+			return EOVERFLOW;
+
+		c = str_decode(src, &offset, STR_NO_LIMIT);
+		dest[di++] = c;
+	} while (c != '\0');
+
+	dest[dlen - 1] = '\0';
+	return EOK;
+}
+
 
 /**
Index: uspace/srv/fs/fat/fat_dentry.h
===================================================================
--- uspace/srv/fs/fat/fat_dentry.h	(revision 4372b49b76fe110218c2e4d58757d8b1815ecf84)
+++ uspace/srv/fs/fat/fat_dentry.h	(revision 9553d7d87cd577b119b96a55a3bfb106c2d072e8)
@@ -141,4 +141,5 @@
 extern size_t fat_lfn_copy_entry(const fat_dentry_t *, uint16_t *, size_t *);
 extern int utf16_to_str(char *, size_t, const uint16_t *);
+extern int str_to_utf16(uint16_t *, size_t, const char *);
 
 
