UTF-8 support - char or wchar_t?

Carlo Wood carlo@alinoe.com
Sun Jun 20 20:36:00 GMT 2004


On Sun, Jun 20, 2004 at 08:12:13PM +0200, Paolo Carlini wrote:
> To bel clear, if you *amend* your testcase as follows:
> 
> #include <iostream>
> 
> int main()
> {
>  std::ios::sync_with_stdio(false);
> 
>  std::wcout.imbue(std::locale("fi_FI.UTF-8"));
>  std::wcout << 1224 << std::endl;
> }

This confuses me too (and I will need it too in the
near future for a GTK+ application).

Can you please explain why one needs wchar_t (wcout)
at all when using UTF-8?  I'd expect that UTF-8 fits
in a stream of 8-bit octets and no wchar_t should
be needed at all.

I am sorry to be off topic - but this is highly confusing.

-- 
Carlo Wood <carlo@alinoe.com>



More information about the Libstdc++ mailing list