Skip to content

Encoding problems #225

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

Closed
geotinc opened this issue Sep 27, 2021 · 12 comments
Closed

Encoding problems #225

geotinc opened this issue Sep 27, 2021 · 12 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@geotinc
Copy link

geotinc commented Sep 27, 2021

Hello, don't know if it's a real problem but the following code :

image

produce the following response in postman :
image

how to have the real key like "Test" and "accessToken" ?

Thanks for helping

@The-EDev
Copy link
Member

Like I said in the other issue, this has never happened, could you please provide more information? do the json examples work fine?

@The-EDev The-EDev added the further information required existing information is lacking, or feedback is required label Sep 27, 2021
@geotinc
Copy link
Author

geotinc commented Sep 27, 2021

I try the example code :
image
And I have the same problem :
image

@The-EDev
Copy link
Member

Used the exact same code as you, got this:
image

Can you tell me what OS you're running, what compiler version, what Crow version, etc...

@The-EDev The-EDev added the bug Something isn't working label Sep 27, 2021
@geotinc
Copy link
Author

geotinc commented Sep 27, 2021

It seems that it is an UT8 error :
116 101 115 116 in hexadecimal is :
74 65 73 74 = "test"

image

My os is :
image

I build with Visual Studio 2019 :
image

and the crow version has been installed with vcpkg :
image

Hope it help.

Thanks a lot.

@The-EDev
Copy link
Member

Can you check the URL in your browser instead of postman? This way we can tell whether it's postman or Crow that's giving the problem

@geotinc
Copy link
Author

geotinc commented Sep 27, 2021

Same in problem in chrome and firefox :
image

@The-EDev
Copy link
Member

The-EDev commented Sep 27, 2021

hmmm, I'll look into why it's doing that

Update: Even when running Windows 10, I can't seem to recreate the problem..

@The-EDev The-EDev removed the further information required existing information is lacking, or feedback is required label Sep 27, 2021
@geotinc
Copy link
Author

geotinc commented Sep 29, 2021

For information, if I return directly a string value without instanciate a
image

It works, do you think other include in my project can alter the rendering of WVVALUE ?

image

@The-EDev
Copy link
Member

it is possible, I don't know what else you're including or what compile settings you have, also it might be best to use this format:
```
Paste Code Here
```
instead of using pictures.

@geotinc
Copy link
Author

geotinc commented Sep 29, 2021

We have found the problem in json.h file in method
inline void escape(const std::string& str, std::string& ret)

We have replace :
for(unsigned char c:str)

by
for(auto c:str)

And it's work.

Any idea to fix the problem at project level without change libraries code ?

@The-EDev
Copy link
Member

The-EDev commented Sep 29, 2021

This is weird.. The code currently in json.h is for (auto c:str), did you mean change that to for(unsigned char c:str) or are you using an old version of Crow?

@The-EDev The-EDev added the duplicate This issue or pull request already exists label Sep 30, 2021
@The-EDev
Copy link
Member

Oh my god, I'm so so sorry. This issue is a duplicate of #195 and has been fixed on master in #196. I don't know how it slipped past me or why I didn't add it in a new hotfix to 0.3. I'm sorry again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants