Making strings of arbitrary character types

Paolo Carlini pcarlini@suse.de
Wed Dec 1 17:57:00 GMT 2004


Nick NoSpam wrote:

>On Wed, 2004-12-01 at 11:22 +0100, Paolo Carlini wrote:
>  
>
>>Right, 3.4.x is vastly better in this area (and we don't have any open 
>>bug ;)
>>    
>>
>I hope this isn't the first.
>
No, it isn't ;)

You have to prepare a suited codecvt facet, able to convert during I/O 
from/to
you internal ("in memory") type (unsigned char) to the external ("on 
disk") type
(char): unfortunately, there is no such as thing as a "general" codecvt...

I suggest taking inspiration from the snippet present in our testsuite, 
in particular:

    testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790*.cc
    + testsuite_character.h

Paolo.



More information about the Gcc mailing list