How to set encoding in fluent NHibernate?

I have created my database by this sql query: ("CREATE DATABASE " + DBName + " DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci", connection)

And I have this fluent configuration:

Fluently.Configure()
                     .Database(MySQLConfiguration.Standard.ConnectionString(c => c.Server(server)
                        .Database(DBName).Username(username).Password(password)))
                     .Mappings(m => m.FluentMappings.AddFromAssemblyOf<Program>())
                     .BuildSessionFactory();

How can I set NHibernate encoding in this configuration? or how can I set my mappings encoding?

I want to this because when I want to select with a property which has UTF8 encoding NHibernate sql will include ??????? in strings with encoding

Answers


var mysqlconf = MySQLConfiguration.Standard
.ConnectionString(c => c.Is("Server=srv;Database=db;User=dev;Password=pass;CharSet=utf8"));

return Fluently.Configure().Database(mysqlconf).Mappings(m =>
    m.FluentMappings.AddFromAssemblyOf<Program>()).BuildSessionFactory();

Setting the database encoding is not related to Fluent NHibernate. Check your connection string, it should be like:

Server=myServerAddress;Database=myDataBase;Uid=user;Pwd=passw; CharSet=UTF8;

Need Your Help

Image click after animation

android click android-animation

I have this strange issue. I have an image which I rotate about a fixed point using rotateAnimation.

Setting CPView frame so that it encases drawn rect

objective-c cocoa cappuccino objective-j

my goal in Cappuccino is to adjust the CPView's frame so that every point of a drawn rect is encased. The rect is rotatable which makes it tricky: