mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Extend handle_printf_atsign() to output unicode in wprintf
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22431 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
974d119dd8
commit
0bff22450f
2 changed files with 18 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
|||
2006-02-05 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSString.m: (handle_printf_atsign()) extend to support wprintf.
|
||||
|
||||
2006-02-01 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/Additions/Unicode.m: Try to use iconv transliteration for
|
||||
|
|
|
@ -79,6 +79,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include "GNUstepBase/Unicode.h"
|
||||
|
||||
|
@ -446,9 +447,19 @@ handle_printf_atsign (FILE *stream,
|
|||
#else
|
||||
string_object = *((id*) ptr);
|
||||
#endif
|
||||
len = fprintf(stream, "%*s",
|
||||
(info->left ? - info->width : info->width),
|
||||
[[string_object description] lossyCString]);
|
||||
if (info->wide)
|
||||
{
|
||||
len = fwprintf(stream, L"%*ls",
|
||||
(info->left ? - info->width : info->width),
|
||||
[[string_object description]
|
||||
cStringUsingEncoding: NSUnicodeStringEncoding]);
|
||||
}
|
||||
else
|
||||
{
|
||||
len = fprintf(stream, "%*s",
|
||||
(info->left ? - info->width : info->width),
|
||||
[[string_object description] lossyCString]);
|
||||
}
|
||||
return len;
|
||||
}
|
||||
#endif /* HAVE_REGISTER_PRINTF_FUNCTION */
|
||||
|
|
Loading…
Reference in a new issue