# Cinder-Protocol HttpServerApp UTF8

**URL:** <https://discourse.libcinder.org/t/cinder-protocol-httpserverapp-utf8/275>\
**Category:** CinderBlocks\
**Created:** [September 19, 2016, 9:59pm UTC](https://discourse.libcinder.org/t/cinder-protocol-httpserverapp-utf8/275 "2016-09-19T21:59:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![colin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/colin/32/604_2.png) [@colin](https://discourse.libcinder.org/u/colin)\
**Post date:** [September 19, 2016, 9:59pm UTC](https://discourse.libcinder.org/t/cinder-protocol-httpserverapp-utf8/275/1 "2016-09-19T21:59:41Z")

</div>

Hello,

I test Cinder-Protocol with [HttpServerApp](https://github.com/BanTheRewind/Cinder-Protocol/tree/master/samples/HttpServer) and UTF8 character like é à…

I send with firefox :  
\>

> ```
> <div class="form-group">
> <label for="text_0">Text Box 0</label>
> <textarea name="text_0" class="form-control" rows="3"></textarea>
> </div>
> <div class="form-group">
> <label for="text_1">Text Box 1</label>
> <textarea name="text_1" class="form-control" rows="3"></textarea>
> </div>
> <div class="checkbox">
> <label>
> <input type="checkbox" name="checkbox">A Check Box</input>
> </label>
> </div>
> <button type="submit" class="btn btn-default">Submit</button>
> </form>
> 
> ```

After it display into firefox :

> ```
> "text_0=éé
> text_1=àà
> checkbox=on
> "
> 
> ```

I receive in C++ console :

> ```
> POST / HTTP/1.1
> Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> Accept-Encoding:gzip, deflate
> Accept-Language:fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
> Connection:keep-alive
> Content-Length:39
> Content-Type:text/plain
> Host:127.0.0.1:2000
> Upgrade-Insecure-Requests:1
> User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0
> 
> ```

> ```
> text_0=Ã©Ã©
> text_1=Ã Ã
> checkbox=on
> 
> ```

I don’t understand why text\_0 and text\_1 is not well formated Ã©Ã© and Ã Ã

Any idea ?

Thanks

---

<div class="post-metadata">

**Author:** ![paul.houx](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/paul.houx/32/31_2.png) [@paul.houx](https://discourse.libcinder.org/u/paul.houx)\
**Post date:** [September 19, 2016, 10:05pm UTC](https://discourse.libcinder.org/t/cinder-protocol-httpserverapp-utf8/275/2 "2016-09-19T22:05:49Z")

</div>

Try adding the correct charset, see:  
[https://www.w3.org/International/articles/http-charset/index](https://www.w3.org/International/articles/http-charset/index)

---

<div class="post-metadata">

**Author:** ![colin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/colin/32/604_2.png) [@colin](https://discourse.libcinder.org/u/colin)\
**Post date:** [September 19, 2016, 10:23pm UTC](https://discourse.libcinder.org/t/cinder-protocol-httpserverapp-utf8/275/3 "2016-09-19T22:23:38Z")

</div>

It was already added in httpServer code response C++ like :  
mHttpResponse.setHeader( “Content-Type”, “text/html; charset=utf-8” );

and into html file like :  
meta http-equiv=“Content-Type” content="text/html;charset=utf-8"  
meta charset=“utf-8”

See [file](http://colinbouvry.com/test/DocumentRoot/index.html)

---

<div class="post-metadata">

**Author:** ![paul.houx](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/paul.houx/32/31_2.png) [@paul.houx](https://discourse.libcinder.org/u/paul.houx)\
**Post date:** [September 19, 2016, 11:05pm UTC](https://discourse.libcinder.org/t/cinder-protocol-httpserverapp-utf8/275/4 "2016-09-19T23:05:56Z")

</div>

Could be that the output console only supports ASCII. I know that’s the case in Visual Studio.

---

<div class="post-metadata">

**Author:** ![colin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/colin/32/604_2.png) [@colin](https://discourse.libcinder.org/u/colin)\
**Post date:** [September 19, 2016, 11:27pm UTC](https://discourse.libcinder.org/t/cinder-protocol-httpserverapp-utf8/275/5 "2016-09-19T23:27:51Z")

</div>

No the console display well the accent coded in UTF8

console() \<\< “réquest :” \<\< endl

work well !

---

<div class="post-metadata">

**Author:** ![xumo](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/xumo/32/75_2.png) [@xumo](https://discourse.libcinder.org/u/xumo)\
**Post date:** [May 4, 2017, 12:39pm UTC](https://discourse.libcinder.org/t/cinder-protocol-httpserverapp-utf8/275/6 "2017-05-04T12:39:36Z")

</div>

Any updates on this matter? Dis you sorted out colin?

I’m now coding in portuguese OS’s and will do some webservices request ans listeneners, so would aprecciate to render them in a TextBox.

**EDIT** : For future use of myself and other in non english OS’s this can remove runtime error, turnig all received/used string to UTF8:  
\> std::string temp;  
\> utf8::replace\_invalid(originalString.begin(), originalString.end(), back\_inserter(temp));

With #include “utf8cpp/checked.h”
