[sqlite] I don't know how to cast ‘const unsigned char*’ to a 'const std::string'

2015-08-12 Thread Andy Ling
> Actualy (maybe I wrong) but it leads to the same result in that case > that using `reinterpret_cast` > > my problem about doing that is I don't know if it's safe... > I mean, should I not get some mess with some char code > (UTF8)? > You could create a new unsigned string type typedef

[sqlite] I don't know how to cast ‘const unsigned char*’ to a 'const std::string'

2015-08-12 Thread Nicolas Jäger
thx Andy, I'll keep that one close. When my program will be ready to perform some tests with UTF8 encoding, I'll try your solution. regards, Nicolas Le Wed, 12 Aug 2015 16:02:54 +, Andy Ling a ?crit : > > Actualy (maybe I wrong) but it leads to the same result in that case > > that using

[sqlite] I don't know how to cast ‘const unsigned char*’ to a 'const std::string'

2015-08-12 Thread Nicolas Jäger
Hi, Actualy (maybe I wrong) but it leads to the same result in that case that using `reinterpret_cast` my problem about doing that is I don't know if it's safe... I mean, should I not get some mess with some char code (UTF8)? I was expecting some people already did a such cast in the past and

[sqlite] I don't know how to cast ‘const unsigned char*’ to a 'const std::string'

2015-08-12 Thread John McKown
On Tue, Aug 11, 2015 at 9:06 PM, Nicolas J?ger wrote: > Hi, > I have some basic problem, but I didn't found the solution so far... > maybe some people are using C++ and already deal with that problem : > > conversion from ?const unsigned char*? to non-scalar type ?std::string > > I got the

[sqlite] I don't know how to cast ‘const unsigned char*’ to a 'const std::string'

2015-08-11 Thread Nicolas Jäger
I may found a solution by using 'reinterpret_cast'. Not sure that is a good solution... nicolas

[sqlite] I don't know how to cast ‘const unsigned char*’ to a 'const std::string'

2015-08-11 Thread Nicolas Jäger
hi John, actualy what you suggest it's the common solution. You missed the fact that here, there is an unsigned... in > http://stackoverflow.com/questions/1195675/convert-a-char-to-stdstring you can read : "It has taken me so long to realize that this constructor absolute refuses to match

[sqlite] I don't know how to cast ‘const unsigned char*’ to a 'const std::string'

2015-08-11 Thread Nicolas Jäger
Hi, I have some basic problem, but I didn't found the solution so far... maybe some people are using C++ and already deal with that problem : conversion from ?const unsigned char*? to non-scalar type ?std::string I got the `const unsigned char*` from `sqlite3_column_text()` and I want to pass

[sqlite] I don't know how to cast ‘const unsigned char*’ to a 'const std::string'

2015-08-11 Thread Nicolas Jäger
Hi, I have some basic problem, but I didn't found the solution so far... maybe some people are using C++ and already deal with that problem : conversion from ?const unsigned char*? to non-scalar type ?std::string I got the `const unsigned char*` from `sqlite3_column_text()` and I want to pass

[sqlite] I don't know how to cast ‘const unsigned char*’ to a 'const std::string'

2015-08-11 Thread John McKown
Perhaps this will help: http://stackoverflow.com/questions/1195675/convert-a-char-to-stdstring IIRC, something ike std::string return_string(pointer_to_const_unsigned_char_var); return_string is an std::string initialized to the value pointed to my the variable in the initializer. If you want