Hi.
I'm creating a small program that use the curl library (
http://curl.haxx.se/) to interact with a php based service.In some functions i need to send post data in urlencoded format ( like
http://www.w3schools.com/TAGS/ref_urlencode.asp ), and to do this, i simply convert the code of each char in the string in his hex value.
For example "abc" is converted in this string: "%61%62%63" , but when i have converted the character 'è' i have discovered that in std::string, it uses 2 bytes according to Utf format.
In another test i stored 'è' in a string but now it uses only 1 byte.
So, what kind of encoding is used?
The string internal encoding type is defined at runtime according to the system default encoding?
another less important question is why if i do:
cout << (char)138;
it print the exact character 'è', but with
cout <<'è';
it print a strange char (is converted in -24 ) ???
(sorry for english).
Thanks.