I did (EVENTUALLY!) get Slide working with Chinese characters, but I had
to make some changes to the source code.  Basically, I had to derive two
new classes from JDBCDescriptorStore and JDBCContentStore. (I didn't
change the base Slide code, I just tell the slide.def config file to use
my classes instead of the original Slide classes.)  I am using mySQL to
store both the meta-data and the content itself.  Trouble is, my version
of mySQL doesn't correctly handle UTF-8 characters, even in BLOB
fields.  When you store a UTF-8 string into a BLOB field and then read
it back, you don't get back what you put in!  I have no idea what crazy
nonsense mySQL is doing to pull this annoying stunt. But I discovered
that if you store the UTF-8 as a blob, and read it back as bytes, then
it all works correctly.  In other words, for the "insert" statements
involving UTF-8 strings I create a blob and then use it for the insert
as follows:

INSERT STATEMENTS
-----------------

String value; // some UTF-8 string
blob.setBytes( 1, value.getBytes( "utf8" ) )
.....
PreparedStatement statement;  // some PreparedStatement for inserts
statement.setBlob( paramindex, blob )

instead of what the original code does:

statement.setString( paramindex, value )


SELECT STATEMENTS
-----------------

PreparedStatement statement;  // some PreparedStatement for selects
statement.setBytes( paramindex,, uri.toString().getBytes( "utf8" ) );

instead of the original code:

statement.setString( paramindex,, uri.toString() );


RESULTSET PROCESSING
--------------------

Finally, when processing the ResultSet

ResultSet res; // some ResultSet

byte[] bytes = res.getBytes( colindex );
String encval = new String( bytes, "utf8" )

instead of the original code:

res.getString( colindex );


If anybody is using a newer version of mySQL that supposedly supports
UTF8 all of the above may be unnecessary.  I would be interested to know
if this is indeed the case, and if somebody has Slide working with UTF8
and mySQL.



On Tue, 2003-07-22 at 20:21, Michael Plomer wrote:
> Hello Peder,
> Hello all,
> 
> I have the same problem. From what I've learned, the problem is
> that the server uses a platform-specific encoding while IE uses
> UTF-8 or something... a solution has been proposed on this list
> a while ago that involved setting the parameter
> 
> org.apache.slide.urlEncoding=UTF-8
> 
> in the slide.properties of the servlet. However, I found that it
> didn't work for me or at least doesn't work with slide 1.0.16.
> It would appear that the parameter in question is never used in
> the source code. So maybe modification of the server side boils
> down to making it use UTF-8 by default?
> 
> I'm using the Slide WebDAV Client lib which also uses UTF-8 by
> default for url encoding. I modified the client lib to use the
> same encoding that my server uses (Cp1252) which seems to have
> solved the problem for all methods derived from HttpMethodBase
> (like mkcol) but doesn't work for methods derived from
> XMLResponseBase (like move). Which makes sense somehow, only
> my knowledge of webdav doesn't stretch far enough to say exactly
> why... :)
> 
> That's for my 2 ct on this, maybe someone with more insight cold
> shed some light on what I'm doing wrong?
> 
> Thanks in advance!
> 
> Regards,
> Michael
> 
> -------/ Michael Plomer    /--/ stud. Hilfskraft CONCERT  /----
> ------/ Fraunhofer IPSI   /--/ Kooperationskomponenten   /-----
> -----/ Darmstadt/Germany /--/ eMail: [EMAIL PROTECTED] /------
> 
> >>-----Urspr�ngliche Nachricht-----
> >>Von: Peder Nordvaller 
> >>[mailto:[EMAIL PROTECTED] 
> >>Gesendet: Dienstag, 22. Juli 2003 13:34
> >>An: Slide Users Mailing List
> >>Betreff: ���
> >>
> >>
> >>Hello, have anyone had any success in making the WebDAV 
> >>servlet using slide
> >>compatible with chars such as the swedish ���? Using internet 
> >>explorer to
> >>open the servlet as a web folder, I can create folders and 
> >>such with those
> >>chars, but when I try to change directory to that directory, 
> >>the url is
> >>translated from "���" to "%E5%E4%F6". How can I avoid/fix 
> >>this? Do I have to
> >>rewrite the slide webdav servlet to actually name them with 
> >>%E5 etc but
> >>display the real chars when listing contents of a dir or is 
> >>there an easier
> >>solution?
> >>
> >>Sincerely, Peder
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to