# SDL wide char support. ncursesw support

**URL:** https://discourse.cataclysmdda.org/t/sdl-wide-char-support-ncursesw-support/5170
**Category:** The Garage
**Created:** [February 22, 2014, 2:27pm UTC](https://discourse.cataclysmdda.org/t/sdl-wide-char-support-ncursesw-support/5170 "2014-02-22T14:27:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![LazyCat-rus](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@LazyCat-rus](https://discourse.cataclysmdda.org/u/LazyCat-rus)
#### Post date: [February 22, 2014, 2:27pm UTC](https://discourse.cataclysmdda.org/t/sdl-wide-char-support-ncursesw-support/5170/1 "2014-02-22T14:27:45Z")

</div>

Breaking news:  
On linux Cataclysm linked with ncursesw(wide char) but it’s headers have never! included.  
This can be seen in cursesdef.h +10:

```auto

```

This string assumes that compiler was launched with included ncursesw headers `ncursesw5-config --cflags` (-I/usr/include/ncursesw). In Makefile this is not happening. So ncursesw now works with ncurses on Linux(why link?) rather ncursesw. This can be fixed easily.

Bug/Problem:  
I have made fix of Issue [#6008](https://github.com/CleverRaven/Cataclysm-DDA/issues/6008) in my local branch. It’s working. Almost full support of Unicode. It was my second try. Fix based on nucursesw function add\_wch(… cchar\_t \*). cchar\_t is defined in ncursesw/curses.h:

`typedef struct
{
    attr_t attr;
    wchar_t chars[CCHARW_MAX];
}cchar_t;`  
This function simply prints Unicode char on terminal. There is one more possible way to fix issue #6008. This is very very WRONG way. It’s possible to use slice of C sring with utf\_8 sequence to represent single Unicode character and print this slice with mvwprintz().  
Lots of problems are appearing during setting TILES=1.  
Ncurses Headers aren’t included during compilation with SDL. As I understood all Ncursers functions is emulated in Cataclysm code(cursesport.cpp). Please, confirm this. If it’s true, do I need realize add\_wch() by myself?

Furthermore.  
It’s a problem with Ncurses on MAC OSX. On default, on MAC OSX Cataclysm is compiling with Ncurses support. But not with ncursesw support. Is ncursesw exist on MAC OSX? Any problem with native compilation?

Any problems with ncursesw on CYGWIN?

This problems block resolving of Issue #6008…

---

<div class="post-metadata">

### Author: ![KA101](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@KA101](https://discourse.cataclysmdda.org/u/KA101)
#### Post date: [February 26, 2014, 6:19am UTC](https://discourse.cataclysmdda.org/t/sdl-wide-char-support-ncursesw-support/5170/2 "2014-02-26T06:19:50Z")

</div>

We’ve got a project to migrate to SDL2 in the works, should land after 0.A. Any thoughts on whether that’ll help?

---

<div class="post-metadata">

### Author: ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)
#### Post date: [February 28, 2014, 7:05am UTC](https://discourse.cataclysmdda.org/t/sdl-wide-char-support-ncursesw-support/5170/3 "2014-02-28T07:05:44Z")

</div>

If I recall correctly, OSX only has [ncurses.so](http://ncurses.so), but it’s actually the wide version under the hood.  
On my system “ncursesw5-config --cflags” outputs “”, so I’m not sure what needs to be done about that.  
I THINK waddch(), which is in catacurses does what you need, we just need better handling throughout the codebase.

---

<div class="post-metadata">

### Author: ![i2amroy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/i2amroy/32/909_2.png) [@i2amroy](https://discourse.cataclysmdda.org/u/i2amroy)
#### Post date: [February 28, 2014, 7:11am UTC](https://discourse.cataclysmdda.org/t/sdl-wide-char-support-ncursesw-support/5170/4 "2014-02-28T07:11:31Z")

</div>

> [@Kevin Granade](#):
>
> If I recall correctly, OSX only has ncurses.so, but it’s actually the wide version under the hood.

Yeah OSX combined both versions into a single library a long time back, if you for some reason need to specifically call the wide version all you do is point it at the same library and it handles it IIRC.
