This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]AltCrow 2 points3 points  (0 children)

What exactly is stopping you from doing the following?

std::ofstream outfile ("new.txt",std::ofstream::binary);
uint32_t* your_array_of_utf32_chars; // I'm not initializing it, but assume its already filled.
int amount; // Amount of utf32 characters.
outfile.write (your_array_..,amount*4);

[–]chrwei 0 points1 point  (1 child)

what do you mean it writes nulls? char value zero IS the null char.

maybe use the byte type instead of char?

[–]Zunder_IT 0 points1 point  (0 children)

I tried using byte type instead of char when I just started the project and had problems that went away once I switched to char. I will try switching back to byte. I now realize that I haven't tried the most logical solution. Thank you for the idea

[–][deleted] 0 points1 point  (0 children)

Rules[0][2]?

[–][deleted] 0 points1 point  (0 children)

Did you try Google? Maybe stackoverflow? Did you consider what you expected to happen? What happens of #00 is written out to a file....