Skip to contentSkip to conversation

-smb switch and national character support

Qemu-devel Kosma 1 participant 1 message May 11, 2006

lore
Share & tools
lore

Kosma

author
#0 lore raw

With the default settings, using -smb switch causes the national characters in shared files' names to display incorrectly. I've put together a simple patch (attached for reference only) that addresses this issue. As this feature looks useful for me, I thought it would be nice to include such functionality in qemu.

The idea is simple - using -smb-dos-charset and -smb-unix-charset switches to archieve the desired goal. Example usage:

	qemu -smb-dos-charset cp852 -smb-unix-charset iso8859-2

Also, another switch, named for example -smb-read-only, would be useful. As the number of options is growing, it might be better to introduce another form:

	-qemu-options dos-charset=cp852,read-only,...

Or, making a more general approach:

-smb directory[,options]

As it is with -net and other switches. However, the charset settings should be put in the [global] section. We can introduce another switch or use a simple and nice hack:

	-smb global,charset=cp852,...

Also, this form of -smb switch would allow to inject _any_ strings into the smb.conf file, making it far more flexible.

As always, comments are welcome before I start to work on the code - I don't want to make a patch that would be rejected.

Kosma

vl.c +3 -0
diff -urp qemu-0.7.2/vl.c qemu-0.7.2-pl/vl.c
@@ -1605,6 +1605,9 @@ void net_slirp_smb(const char *exported_
             "log file=%s/log.smbd\n"
             "smb passwd file=%s/smbpasswd\n"
             "security = share\n"
+	    "dos charset=CP852\n"
+	    "unix charset=ISO8859-2\n"
+	    "display charset=ISO8859-2\n"
             "[qemu]\n"
             "path=%s\n"
             "read only=no\n"