Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Garbled when I insert entity data with chinese characters #1902

Closed
qingyun-zhao opened this issue Nov 9, 2018 · 1 comment
Closed

Garbled when I insert entity data with chinese characters #1902

qingyun-zhao opened this issue Nov 9, 2018 · 1 comment

Comments

@qingyun-zhao
Copy link

these day ,i tried insert chinese characters to table of mysql through Entities of NHibernate ,but when i open that inserted table,discover inside all chinese characters is become question mark(like: values(???)) , i doubt not mysql encode problem, but NHibernate inside encode deal with problem. the NHibernate version at that time is 4.0.1.400.

@fredericDelaporte
Copy link
Member

fredericDelaporte commented Nov 9, 2018

NHibernate has a test for this, and it succeeds with MySQL. (Guest login available.)

[Test]
public void InsertUnicodeValue()
{
const string unicode = "길동 최고 新闻 地图 ます プル éèêëîïôöõàâäåãçùûü бджзй αβ ខគឃ ضذخ";
using (var s = OpenSession())
{
var b = new StringClass { StringValue = unicode };
s.Save(b);
s.Flush();
}
using (var s = OpenSession())
{
var b = s.Query<StringClass>().Single();
Assert.That(b.StringValue, Is.EqualTo(unicode));
}
}

This test has been added in 5.1 only (#1511), but no changes were required for having it succeed with MySQL.

If you can reproduce the trouble with a test case (see contributing) on master, please re-open the issue and submit the test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants