login about faq

Hello, I am stuck with a Problem related to json & http requests.

The page I want to read contains json data, which contain arabic or russian text.

In Firefox I can see a view for "json" and a view for "rawdata". Json shows the correct language chars used in arabic or russian. Rawdata shows instead e.g. "u0643"...

I did try:

http.put_AcceptCharset(L"utf-8");

//  Send the HTTP GET and return the content in a string.
const wchar_t *html = 0;
html = http.quickGetStr(L"https://api.access-some-site.org/mytoken/getdata");

MessageBoxW(0,html,L"My Data",0);

It seems to always get the rawdata and this means "u0643", not the char!

Now my question: Is there a way to Access my URL to the json via CkHttpW somehow?

asked Jun 19 at 18:17

Bredley's gravatar image

Bredley
112


I think I might need to use CkJsonObjectW to convert text that does not display in language I need.

If I receive like "u0643" which is in fact a german umlaut "Ä" maybe json-class can handle it?

Would I do it like this?

http.put_AcceptCharset(L"utf-8");

// Send the HTTP GET and return the content in a string which is u0643.

const wchar_t *html = 0;

html = http.quickGetStr(L"https://api.access-some-site.org/mytoken/getdata");

//html holds data string like "Hello World! Ä Test" which is "Hello World! u0643 Test"

// place in json object to get back as CStringW?

CkJsonObjectW jsonx;

CStringW output;

jsonx.Load(html);

// output = text in germnan vowel readable

output = jsonx.emit();

MessageBoxW(output,L"testoutput",0);

Buit it still shows up as u0643

:-/

link

answered Jun 20 at 04:42

Bredley's gravatar image

Bredley
112

edited Jun 20 at 04:50

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×203
×25

Asked: Jun 19 at 18:17

Seen: 265 times

Last updated: Jun 20 at 04:50

powered by OSQA