• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: swprintf fails with extended character codes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: swprintf fails with extended character codes


  • Subject: Re: swprintf fails with extended character codes
  • From: "Paul Sanders" <email@hidden>
  • Date: Fri, 9 Apr 2010 14:19:41 +0100

I couldn't get it to work either.  I eventually resorted to this, editing the code to change char to wchar_t (actually, TCHAR):
 
http://hte.sourceforge.net/doxygenized-0.8.0pre1/snprintf_8cc-source.html
 
Note that this code doesn't implement %g, but it is trivial to add it.
 
The libc source is available online, but try as I might I cannot see where swprintf is tripping up:
 
http://sourceware.org/git/?p=glibc.git;a=blob;f=stdio-common/vfprintf.c;h=087bf91b21bee1cf708da0568996b7f508e1b924;hb=e0f86659bebf16c150e1c4cfe385c643c424e322
 
Paul Sanders.
 
----- Original Message -----
From: "Ben Staveley-Taylor" <email@hidden>
To: <email@hidden>
Sent: Friday, April 09, 2010 12:07 PM
Subject: swprintf fails with extended character codes

I'm working in some cross-platform code that uses wchar_t based strings and I'm struggling to understand how swprintf() is supposed to work.

Everything works fine if I use the wide string type as long as the actual character codes do not exceed 255. As soon as my wide string actually contains a true unicode character, swprintf() just returns -1 and an empty string.
...
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >swprintf fails with extended character codes (From: Ben Staveley-Taylor <email@hidden>)

  • Prev by Date: Can't include NTL library in project
  • Next by Date: Re: Go to Counterpart Doesn't Work
  • Previous by thread: swprintf fails with extended character codes
  • Next by thread: Re: swprintf fails with extended character codes
  • Index(es):
    • Date
    • Thread