希伯来语的问题-MySql,C# [英] problem with hebrew - MySql, c#

查看:132
本文介绍了希伯来语的问题-MySql,C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将希伯来语字符串插入MySql时遇到问题.

i've problem to insert hebrew strings to MySql.

简介

  1. 我将MySql设置为Utf8.
  2. 我使用排序规则uft8_general_ci将表设置为字符集utf8
  3. 我将连接字符串设置为:"Server = ; Database = ; Uid = ; Pwd = ; charset = utf8;"
  4. 我编写了由c#使用它的存储过程.
  5. MySql版本:5.1.53
  1. I set the MySql to Utf8.
  2. I set the table as charset utf8 with collation uft8_general_ci
  3. I set the connection string as it: "Server=;Database=;Uid=;Pwd=; charset=utf8;"
  4. I write stored procedure for using it by c#.
  5. Version of MySql: 5.1.53

当我只是通过MySql将希伯来语字符串插入表时 就这样:

when i simply insert hebrew string to table by MySql as it :

insert into temp_table (temp_column) values ('ערך')

我认为是适当的. 如果我将存储过程设置为它..我看到乱码.

i saw as proper. if i set stored procedure as it..i see gibberish.

当我用C#调用它时,出现异常,如错误的字符串值:'\ xD7 \ xAA \ xD7 \ xA8 ..."作为列...'

when i call it by c# i get exception as 'Incorrect string value: '\xD7\xAA\xD7\xA8...' for column...'

如果我插入英文字符串,则一切正常.

if i insert english strings, so i get all as proper.

有什么主意吗?

推荐答案

i已添加到存储过程charset utf8

i added to stored procedure charset utf8

在SP_CityName VARCHAR(100)字符集utf8中, 在SP_CitySynonyms中文本字符集utf8

in SP_CityName VARCHAR(100) charset utf8, in SP_CitySynonyms mediumtext charset utf8

现在工作正常……非常感谢你们.

and now it works fine... thanks a lot to u all.

这篇关于希伯来语的问题-MySql,C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆