List:MySQL++« Previous MessageNext Message »
From:Victor Dudochkin Date:June 29 2010 6:28am
Subject:Error in russian utf-8
View as plain text  
I found error in mysql++.
I use utf-8 encoding.
This is my code:

char * _login = "ч";
    mysqlpp::Query query = con->query();
    query << "SET character_set_client=utf8";
    query.execute();
    query << "SET character_set_connection=utf8"
;
    query.execute();
    query << "SET character_set_results=utf8";
    query.execute();

        query
                << "SELECT auth.*, user.*,userref.refuperc as
refrefuperc,authref.login as reflogin "
                << "FROM auth NATURAL JOIN user "
                << "LEFT JOIN user AS userref ON (userref.userid=auth.refid)
"
                << "LEFT JOIN auth AS authref ON (authref.userid=auth.refid)
"
                << "WHERE auth.login=" << mysqlpp::quote << _login
<< " AND
"
                << "(auth.passmd5 = " << mysqlpp::quote <<
output.c_str()
                << ")";
cout << "LOGIN: " << query.str() << endl; <<< here error
query.store(); <<< here it happen also.

I have an error when i try to print query  or execute it.

This hapen only if i use "ч" char. With other russian characters all OK.

mysqlpp::Query::store() at /usr/include/mysql++/query.h:467. I can send
backtrace, if you need it.

Victor Dudochkin.

Thread
Error in russian utf-8Victor Dudochkin29 Jun
  • Re: Error in russian utf-8Victor Dudochkin29 Jun