+/*
+ * Convert Unicode string into HFS encoding
+ *
+ * ':' chars are converted to '/'
+ * Assumes input represents fully decomposed Unicode
+ */
+int
+unicode_to_hfs(ExtendedVCB *vcb, ByteCount srcLen, u_int16_t* srcStr, Str31 dstStr, int retry)
+{
+ int error;
+ unicode_to_hfs_func_t hfs_get_hfsname = VCBTOHFS(vcb)->hfs_get_hfsname;
+
+ error = hfs_get_hfsname(srcStr, srcLen/sizeof(UniChar), dstStr);
+ if (error && retry) {
+ error = unicode_to_mac_roman(srcStr, srcLen/sizeof(UniChar), dstStr);
+ }
+ return error;
+}
+