
please wait
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. |
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 ) ??? |
During this test, your input was converted to UTF-8 automatically before getting to std::string. During this test, your input remained in ISO-8859-1 and got pushed onto the std::string like that. |
Something wrong with your locale or how your editor is writing source. 138 and -24 are not complements of each other. |
there is a way to ensure that all the input is converter every time to the same format? |
maybe because the ide( codeblock) save the test file in utf8 ( because there are many strange chars like $,§ ecc.. i used to test it) and gcc does not read correctly the source during compilation? |