Hi,
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,
Jaroslav
Hi,
from what I know KDS doesn't have other replacement function for swprintf.
I think the only "fix" is to use 4bytes buf for swprintf.
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Jennie,
I am afraid that you are right.
My problem is, that I need to convert existig CW project to KDS.
The project has a lot of code included 2byte strings in Flash, od SDHC card and
on the "other side" of USB. It is not simple to convert all of them.
Best regards
Jaroslav