s(n)printf for wchar_t

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

I recently stumbled over a small problem with the toolchain delivered with Atmel Studio 6.2 (r1563).

I needed to convert all my variables of the type "char" to "wchar_t" (16-bit wide btw...) to be able of using native characters of foreign languages in my sourcecode.

In the sourcecode I so far used snprintf to insert some units and numbers here and there in my display-output.

After changing all my char-arrays to wchar_t-arrays I had to realize that those nifty little helpers like "wprint" and "swprinft" (http://linux.about.com/library/cmd/blcmdl3_wprintf.htm) are somehow missing in the toolchain.

 

I included stdio.h and wchar.h. Am I missing something? Why is there support for wide characters at all, if all these (quite important) functions are missing?

 

Greetings,

Kai

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why is there support for wide characters at all, if all these (quite important) functions are missing?

Surely one is a compiler entity and the other is a C library entity? Just because a compiler supports something (especially a generic, multi CPU compiler like GCC) doesn't necessarily mean that the C library for a particular CPU architecture is going to have everything to match that core feature. The issue with GCC is that it's an open source, open development. For things like wide chars or <time.h> or other "Non essential" library functionality it's kind of up to one of the users to see the need for it, develop the support then donate it back to the core compiler/library development projects.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmm, thanks for your reply clawson.

 

But as much as I`d like to contribute with an own implementation of (v(sw))printf() I think I am running out of time.

Perhaps I should have asked before here:

Am I on the right path at all? How do chinese people for example use strings with the Atmel Development Environment?

 

Greetings,

Kai