Sponsored Content
Full Discussion: wchar_t
Top Forums Programming wchar_t Post 302405733 by cyler on Friday 19th of March 2010 06:57:30 PM
Old 03-19-2010
wchar_t

1. Can anybody tell me why this outputs: Ros? (My locale is: en_US.UTF-8 and I'm using gcc)
2. I need wchar_t if I want to use chars with accents ?
3. Can I use UTF-8 with wchar_t ?

Code:
#include <stdio.h>
#include <wchar.h>

int main(void)
{
    wchar_t VAR[10]= L"Rosé";

        wprintf(VAR); // Ros?

        return 0;
}

 

We Also Found This Discussion For You

1. Programming

_fopen with wchar_t*

how can I use function _fopen(char* , char*) if name of the file with wide char symbols? (0 Replies)
Discussion started by: nickppv2000
0 Replies
WPRINTF_L(3)						   BSD Library Functions Manual 					      WPRINTF_L(3)

NAME
wprintf_l, fwprintf_l, swprintf_l, vwprintf_l, vfwprintf_l, vswprintf_l -- formatted wide character output conversion LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stdio.h> #include <wchar.h> #include <xlocale.h> int fwprintf_l(FILE * restrict stream, locale_t loc, const wchar_t * restrict format, ...); int swprintf_l(wchar_t * restrict ws, size_t n, locale_t loc, const wchar_t * restrict format, ...); int wprintf_l(locale_t loc, const wchar_t * restrict format, ...); #include <stdarg.h> int vfwprintf_l(FILE * restrict stream, locale_t loc, const wchar_t * restrict, va_list ap); int vswprintf_l(wchar_t * restrict ws, size_t n, locale_t loc, const wchar_t *restrict format, va_list ap); int vwprintf_l(locale_t loc, const wchar_t * restrict format, va_list ap); DESCRIPTION
The wprintf_l(), fwprintf_l(), swprintf_l(), vwprintf_l(), vfwprintf_l(), and vswprintf_l() functions are extended locale versions of the wprintf(), fwprintf(), swprintf(), vwprintf(), vfwprintf(), and vswprintf() functions, respectively. Refer to their manual pages for details. Also, see xlocale(3) for more information about extended locales. SEE ALSO
wprintf(3), xlocale(3) BSD
March 11, 2005 BSD
All times are GMT -4. The time now is 06:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy