C++ Logo

sg16

Advanced search

Re: [SC22WG14.22429] Agenda for the 2022-07-27 SG16 telecon

From: Marcus Johnson <marcusljohnson1991_at_[hidden]>
Date: Thu, 28 Jul 2022 08:05:39 -0400
Hey Tom, been thinking about that fread/fwrite encoding issue, wrote something up real quick, though it operates on file handles not descriptors, what do you think though?

Basically just fwide, but for encodings

typedef enum fCharacterSetModes {
    fCharacterSetMode_ReadValue = 0,
    fCharacterSetMode_PrependBOM = 1,
    fCharacterSetMode_Ascii = 2,
    fCharacterSetMode_UTF8 = 3,
    fCharacterSetMode_UTF8_BOM = 4,
    fCharacterSetMode_UTF16_LE = 5,
    fCharacterSetMode_UTF16_LE_BOM = 6,
    fCharacterSetMode_UTF16_BE = 7,
    fCharacterSetMode_UTF16_BE_BOM = 8,
    fCharacterSetMode_UTF32_LE = 9,
    fCharacterSetMode_UTF32_LE_BOM = 10,
    fCharacterSetMode_UTF32_BE = 11,
    fCharacterSetMode_UTF32_BE_BOM = 12,
    // Any other value higher is reserved for implementations to say their own code page values.
} fCharacterSetModes;

fCharacterSetModes fUnicode(FILE *Stream, fUnicodeModes Mode);

Received on 2022-07-28 12:05:43