From StackOverflow,

-------------------------------

fgets() can decode UTF-8 encoded files if you use Visual Studio 2005 and
up. Change your code like this:


infile = fopen(inname, "r, ccs=UTF-8");



On Sat, Nov 23, 2013 at 8:25 PM, Nishant Pandey <
[email protected]> wrote:

> Q) *C program* that reads multiple UTF-8 encoded strings from STDIN (1
> string per line), count all *non-ascii* characters (ascii characters are
> with ordinal decimal 0 to 127) and print the total non-ascii character
> count to STDOUT (1 number per line).
>
> Contraint :
>
>
>    - You cannot use any *wchar.h* service in your program.
>    - The UTF-8 strings supplied to you can have *1 or more whitespaces* in
>    them.
>    - No input string will have a character length greater than*200 *(including
>    spaces)
>    - You will be given multiple lines of input (1 string per line).
>    - Input will be limited to UTF-8 encoded strings and will not contain
>    any garbage values.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].

Reply via email to