[Mono-dev] SQL query encoding problem using mod_mono

Ronan bernabe.ronan at free.fr
Fri Dec 22 05:30:46 EST 2006


I try many solution as changing database encoding, page encoding or 
default language encoding.
And the same compiled web application give different result on XSP and 
apache with mod_mono.
Now I'm using MySql.Data.dll, not bytefx.data.mysql anymore, and all 
works fine !!! :-)
MySql.Data.dll could be found at 
http://dev.mysql.com/downloads/connector/net/1.0.html .

Best regards,


Marek Habersack a écrit :
> 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
> ------------------------------------------------------------------------
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061222/68b9a1eb/attachment.html 

More information about the Mono-devel-list mailing list