AnsweredAssumed Answered

2byte Unicode in KDS3.2  /wchar_t

Question asked by Jaroslav Brazdil on Jul 13, 2016
Latest reply on Jul 18, 2016 by Jaroslav Brazdil


I want to use 2 byte Unicode in my KDS3.2 / SDK 2.0project .

I have found this : Unicode support in KDS3.0?


and I set my compile parametr for GCC    (Properties /  C/C++ Build / Cross ARM C Compiler / Miscellanous / other compiler flags):      -fshort-wchar


It can generate 2 byte unicode strings.

Is it possible to use functions from wchar.h   as 

swprintf, (wchar_t *__restrict, size_t,  const wchar_t *__restrict, ...);  ?



When I try to use


  wchar_t buf[20];

  swprintf(buf, 20, L"%ls", L"XAHOJ123456");


the buffer buf[20] is set as 2byte,

the functin use buf as 4byte , the buf is overloaded in the swprintf()

and a hard fault error ocure.


Have I use other library, or copile the library somehow?



Thank You,