In a windows C ++ console application, I would like to read the password from the input on the command line. The password is used for encryption (and later decryption, possibly in other countries of the world on a Windows PC with a different locale). Therefore, I am worried about the locales and coding of this code phrase, which does not give the same numerical representation. On the same computer or computer with the same language, this clearly does not give a problem.
Therefore, I would like to be able to fix the encoding (and normalize?) And store it as UTF-8. which is recommended here: http://www.jasypt.org/howtoencryptuserpasswords.html (paragraph 4).
There are many problems associated with the encoding / unicode / UTF-8 / code pages, which I do not fully (or completely do not understand). I was messing around with boost: locale and boost :: nowide, but couldn't figure out whether or not it works under windows (dunno). Some links with more detailed information about problems (windows):
http://alfps.wordpress.com/2011/11/22/unicode-part-1-windows-console-io-approaches/
http://alfps.wordpress.com/2011/12/08/unicode-part-2-utf-8-stream-mode/
But these links address the opposite problem! How to make things look the same no matter what the main view, I need the same basic [bitwise] view, no matter how it looks!
So the question is, how can I be sure (and should I?) So that the language / encoding does not affect the main data that is encrypted, the data, as in the sense of an array of 8-bit integers? I don't necessarily care about UTF-8 or Unicode, I just need to be able to recover data regardless of language / encoding. The first link will help in explaining the problem.
Thoughts, C does not know about Unicode, refers to some help on C-code, or does C ++ change it again? Or will it restrict the input of the characters "ASCII" (I know that it does not exist in Windows) ALWAYS, as in "on any Windows computer") work?
Decision:
void EncryptFileNames ( const boost::filesystem::path& p, const std::string& pw ); int main ( int argc, char **argv )
Thanks to all the contributors.
PS: For encryption I use Crypto ++ with VS2008SP1 and Boost (without ICU backend).