# HTTP Client returning the right decode string

**URL:** <https://forums.fusetools.com/t/http-client-returning-the-right-decode-string/2663>\
**Category:** Feature Suggestions\
**Created:** [February 27, 2016, 2:47am UTC](https://forums.fusetools.com/t/http-client-returning-the-right-decode-string/2663 "2016-02-27T02:47:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuanjs](https://avatars.discourse-cdn.com/v4/letter/y/ecccb3/32.png) [@yuanjs](https://forums.fusetools.com/u/yuanjs)\
**Post date:** [February 27, 2016, 2:47am UTC](https://forums.fusetools.com/t/http-client-returning-the-right-decode-string/2663/1 "2016-02-27T02:47:29Z")

</div>

Hi, I use the fetch function to get html page, and found that if the page charset is not UTF8, like some page header has the charset information: `<meta http-equiv="Content-Type" content="text/html; charset=gbk" />`, this kind of page will be decode in UTF8 default, and will get the wrong content. I check the package source code, and fount the problem is here:

```auto
Uno.Net.Http/0.24.5/Implementation/iOS/HttpRequest.mm

line number: 116, 
method: Void Completed(NSData data, NSHTTPURLResponse response, NSError error) 

in this function line number: 130, it use UTF8 decode the response data into string.

```

_I think have better use the method: `GetResponseHeader(uString`_ `key)` to get the charset of the web page, and then use this charset to decode the response data.

Thanks!

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [February 27, 2016, 9:24am UTC](https://forums.fusetools.com/t/http-client-returning-the-right-decode-string/2663/2 "2016-02-27T09:24:27Z")

</div>

Thanks for the tip! I’ve filed an internal ticket pointing to this thread. Our HTTP-guys will have a look 🙂
