Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding problem #87

Open
deadash opened this issue Nov 25, 2021 · 0 comments
Open

Encoding problem #87

deadash opened this issue Nov 25, 2021 · 0 comments

Comments

@deadash
Copy link

deadash commented Nov 25, 2021

I think it should be utf-8 encoding by default, and the corresponding encoding can be generated after setting the default encoding.

Now all the parsing codes have not changed, causing the format result to be wrong.

A very simple improvement is to add the following sentences to the function string q_codec::decode(const string& text) const.

#include <boost/locale.hpp>
using boost::locale::conv::to_utf;

string q_codec::decode(const string& text) const
{
....
     if (!iequals(charset, "utf-8"))
     {
         dec_text = to_utf<char>(dec_text, charset);
     }

    return dec_text;
}

Format again after the change, you can modify the charset according to the corresponding encoding and then encode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant