WebDAV

日本語


an Apache module mod_encoding-20011211a-hotfix.tar.gz written by IIJ Yamada
a patch file for the spec file in apache-1.3.12-25.src.rpm included in RedHat7.0.x apache.spec.patch

mod_dav module, which implements WebDAV in Apache, couldn't handle Japanese correctly. In precise the module doesn't consider character codes except ISO 8859-x. In case of sent the headers in the other codes, the characters corrupt, and of course it couldn't handle the files correctly. Because the module just call open(2) system call when it creates collection/resources(it goes without saying that directories/files in the server's filesystem).

Creating a folder(collection) in Windows 2000 Japanese version is the following(the same as Windows95/98/ME with WebFolder in IE5).

Creating a folder

Creating a folder

It fails that renaming the folder name

renaming the folder name fails

After refreshing, there are two folders, one is the renamed folder, and the other is "New Folder" in shift-jis(Japanese).

Character corrupts

It is Shift-JIS that the character code from Windows to mod_dav. The other is UTF-8.

If apache is running on Linux, because Linux kernel can handle UTF-8, the problem would be fixed by converting the character code with calling iconv(3) before handles the files.

mod_encoding is THE Apache module*1 for the purpose. The modules is written by Mr. Yamada working for IIJ. I've been redistributing the module under his permissions.

Setting up is the same as the usual Apache modules. One just run ./configure, and add `--add-module=mod_encoding.c' line. Install the outcome binary files as usual. After that, add the following directives into the httpd.conf(5), and restart Apache.

LoadModule encoding_module modules/mod_encoding.so
<IfModule mod_encoding.c>
 EncodingEngine on
 SetServerEncoding UTF-8
 AddClientEncoding SJIS   "Microsoft .* DAV"
 AddClientEncoding SJIS   "xdwin9x/"
 AddClientEncoding EUC-JP "cadaver/"
</IfModule>


*1 At the time of this writing :-)


Back