我程序中连接数据后并通过select语句取出记录后, 发现有一个字段是中文的, 取出来后却是乱码. 我大概分析了下: 
例如: 美国, 显示为乱码, 但测其长度为 6, 我自己在linux下测试一个中文占2个字符, 所以我想 美国 长度应该为4才正确. 请问这是环境问题引还是其它原因引起的. 附: red-had linux,  mysql数据库,非oracle. 我客户端工具上的汉字是能正常显示的, 只有在从数据库中取出的数据,我在调试过程中作为变量显示的时候才显示乱码 
strQuerySql += "select ip_start, ip_end, int_ip_start, int_ip_end, city_id, city_name from t_area_ip src_query.reset();
src_query << strQuerySql;
src_res.purge();
src_res = src_query.store();mysqlpp::Row src_row;for (int i=0; i<src_res.num_rows(); ++i)
{
        src_row = src_res.at(i);
        AreaIpRow.ip_start     = src_row.at(0).c_str();
    AreaIpRow.ip_end       = src_row.at(1).c_str();
    AreaIpRow.int_ip_start = src_row.at(2).c_str();
    AreaIpRow.int_ip_end   = src_row.at(3).c_str();
    AreaIpRow.city_id      = src_row.at(4).c_str();
    //AreaIpRow.city_name    = src_row["city_name"];
    AreaIpRow.city_name    = src_row.at(5).c_str(); //这个字段只要为中文就会成乱码.且以每个中文占3个字符显示
下面是我在一环境下单步调试的结果
(gdb) p AreaIpRow.city_name
$6 = {static npos = 4294967295, 
  _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
    _M_p = 0x84ac25c "羜216圲33?"}}
(gdb) p src_row["city_name"]
$7 = {<mysqlpp::const_string> = {str_data_ = 0x84ac188 "羜216圲33?", length_ = 6}, type_ = {
    static string_type = 20 '\024', _length = 0, _max_length = 0, static types = {{sql_name_ = 0xb6feee "DECIMAL NOT NULL",
        ListAreaIp.push_back(AreaIpRow);
}但是奇怪的是我把这些数据作为变量保存在内存中, 然后拼插入语句重新插入数据库后, 这个字段显示的是中文, 并没有出错.