State of C++ Locale support?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

State of C++ Locale support?

Stephen Lee-2
The FAQ says:

>     *   Why don't wide characters work with libstdc++?
>           o The wide-character parts of the GCC Standard C++
>             Library (libstdc++) have not yet been fully ported
>             to Windows.  Alternatives and discussion on this
>             can be found [here].

The discussion referred to in [here] dates back to 2004.

Is this still the case?  Is it currently possible to write a program
that opens a file in some specific locale and read it into wchar_t []
(or wstring) using only MinGW (without other 3rd-party library)?

Stephen

--
Stephen Lee <[hidden email]>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: State of C++ Locale support?

Danny Smith

> Is this still the case?  Is it currently possible to write a program
> that opens a file in some specific locale and read it into wchar_t []
> (or wstring) using only MinGW (without other 3rd-party library)?
>

GCC 4.3.x  and 4.4.0  have  partial support for  wchar_t, wstrings, w[io]stream, etc. on
mingw.   Locales other than C-locale are not supported.
Danny


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: State of C++ Locale support?

Earnie Boyd

Quoting Danny Smith <[hidden email]>:

>
>> Is this still the case?  Is it currently possible to write a program
>> that opens a file in some specific locale and read it into wchar_t []
>> (or wstring) using only MinGW (without other 3rd-party library)?
>>
>
> GCC 4.3.x  and 4.4.0  have  partial support for  wchar_t, wstrings,
> w[io]stream, etc. on
> mingw.   Locales other than C-locale are not supported.

Is there a target for when full support might happen?  I just want to
update the documentation with this data.

Earnie

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: State of C++ Locale support?

Keith Marshall
In reply to this post by Danny Smith
On Wednesday 29 October 2008 08:28:44 Danny Smith wrote:
> > Is this still the case?  Is it currently possible to write a
> > program that opens a file in some specific locale and read it
> > into wchar_t [] (or wstring) using only MinGW (without other
> > 3rd-party library)?
>
> GCC 4.3.x  and 4.4.0  have  partial support for  wchar_t...

I take it we're talking specifically of C++ methods here?

Technically, reading data from a file with a locale specific
encoding, and converting to wchar_t has always been supported,
AFAIK, using the mbtowc() or mbstowcs() functions, which are
provided by MSVCRT, (although Microsoft's implementations may
perhaps be naive, IIRC, in assuming a maximum of two bytes
per multibyte char encoding).

It may not be exactly what the OP is hoping for, but it should
be possible to get the job done, without any requirement for a
3rd party library.

Regards,
Keith.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: State of C++ Locale support?

Danny Smith
>
> On Wednesday 29 October 2008 08:28:44 Danny Smith wrote:
> > > Is this still the case?  Is it currently possible to write a
> > > program that opens a file in some specific locale and read it
> > > into wchar_t [] (or wstring) using only MinGW (without other
> > > 3rd-party library)?
> >
> > GCC 4.3.x  and 4.4.0  have  partial support for  wchar_t...
>
> I take it we're talking specifically of C++ methods here?
>

Specifically, libstdc++ as shipped by GNU project.
There is much better support with 3rd-party libstdc++, eg STLPort.
Danny


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: State of C++ Locale support?

Danny Smith
In reply to this post by Earnie Boyd


> -----Original Message-----
> From: Earnie Boyd [mailto:[hidden email]]
> Sent: Thursday, 30 October 2008 12:10 a.m.
> To: [hidden email]
> Subject: Re: [Mingw-users] State of C++ Locale support?
>
>
>
> Quoting Danny Smith <[hidden email]>:
>
> >
> >> Is this still the case?  Is it currently possible to write
> a program
> >> that opens a file in some specific locale and read it into
> wchar_t []
> >> (or wstring) using only MinGW (without other 3rd-party library)?
> >>
> >
> > GCC 4.3.x  and 4.4.0  have  partial support for  wchar_t, wstrings,
> > w[io]stream, etc. on
> > mingw.   Locales other than C-locale are not supported.
>
> Is there a target for when full support might happen?

I do not know anyone who has committed to do this.
Danny


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: State of C++ Locale support?

François Dumont
Hi

    As I have left the STLport project for which I had specifically
worked on the localisation support I might be interested in helping
MinGW get a better support. With STLport even UTF7/UTF8 encodings was
supported under Windows, it would be great to do the same with MinGW.

    Where should I start ? Is the
gcc-4.3.0-20080502-mingw32-alpha-src.7z
<http://downloads.sourceforge.net/mingw/gcc-4.3.0-20080502-mingw32-alpha-src.7z?use_mirror=>  
package the prefered one to work on ?

Bests

Danny Smith wrote:

>  
>> -----Original Message-----
>> From: Earnie Boyd [mailto:[hidden email]]
>> Sent: Thursday, 30 October 2008 12:10 a.m.
>> To: [hidden email]
>> Subject: Re: [Mingw-users] State of C++ Locale support?
>>
>>
>>
>> Quoting Danny Smith <[hidden email]>:
>>
>>    
>>>> Is this still the case?  Is it currently possible to write
>>>>        
>> a program
>>    
>>>> that opens a file in some specific locale and read it into
>>>>        
>> wchar_t []
>>    
>>>> (or wstring) using only MinGW (without other 3rd-party library)?
>>>>
>>>>        
>>> GCC 4.3.x  and 4.4.0  have  partial support for  wchar_t, wstrings,
>>> w[io]stream, etc. on
>>> mingw.   Locales other than C-locale are not supported.
>>>      
>> Is there a target for when full support might happen?
>>    
>
> I do not know anyone who has committed to do this.
> Danny
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> MinGW-users mailing list
> [hidden email]
>
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users
>
>
>  

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: State of C++ Locale support?

John E. / TDM
François Dumont wrote:
>     Where should I start ? Is the
> gcc-4.3.0-20080502-mingw32-alpha-src.7z
> <http://downloads.sourceforge.net/mingw/gcc-4.3.0-20080502-mingw32-alpha-src.7z?use_mirror=>  
> package the prefered one to work on ?
>  

No; you should definitely download GCC from source control, so it's easy
to merge your changes when they're ready. See
<http://gcc.gnu.org/svn.html>. If you checkout trunk you'll get the 4.4
development branch; it's probably a better idea to get the 4.3 branch:
<svn://gcc.gnu.org/svn/gcc/branches/gcc-4_3-branch>. I've had a lot of
good results with 4.3.2, and I believe (and hope!) that Aaron
LaFramboise is still planning to base a MinGW stable release on the 4.3
series.

-John E.

P.S. -- Don't top post. Harsh people will yell at you.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users