[Mono-dev] SQL query encoding problem using mod_mono

Marek Habersack grendello at gmail.com
Thu Dec 21 09:37:01 EST 2006


On Fri, 15 Dec 2006 18:50:21 +0100, Ronan <bernabe.ronan at free.fr>
scribbled:

> Hi,
Ronan,

> Inserting and extracting special characters from a MySQL database
> works fine with console application or web application using XSP.
> But web application using mod_mono don't insert or extract correctly 
> special characters as accents (special characters are stored as '?').
> Is there a solution for mod_mono working with MySQL ?
[snip]
I suppose your problem might have to do with your language environment.
XSP and mod_mono use the default encoding provided by the mono runtime
(i.e. the value of Encoding.Default) to send strings to the client. If
your apache/xsp environment doesn't contain the LANG variable, or its
value is set to C, then you will get the effect you described above.
So, the short-term solution to your problem would be to set the LANG
variable to, e.g. en_US.UTF-8 in which case the default encoding would
be UTF8 (then you need to make sure that the strings in your source
files and in the database are UTF8, of course). Also, when compiling
your application, make sure the -codepage:utf8 option is present on the
mcs commandline.
Hope that helps a bit,

regards,

marek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061221/dfff24b5/attachment.bin 


More information about the Mono-devel-list mailing list