P
PLS
When I use fopen for reading with the CCS options, the library will look
at the byte order mark to determine the file type and read accordingly.
I have a more compilcated case. I want to open a file for appending I
want the appended data to always be in UTF-8. If the existing file is in
another encoding I will have to copy and convert it before appending. In
the interest of speed I would prefer not to open the file separately
just to determine what the BOM is.
Is it possible to open for appending with CCS=UTF-8 and then determine
what the existing coding is? Then if the existing is wrong I can close
the file and convert it. This way I'm only doing the extra effort if the
file actually needs conversion.
I think the existing encoding is stored in the FILE structure. Is this
documented anywhere?
Thanks,
++PLS
at the byte order mark to determine the file type and read accordingly.
I have a more compilcated case. I want to open a file for appending I
want the appended data to always be in UTF-8. If the existing file is in
another encoding I will have to copy and convert it before appending. In
the interest of speed I would prefer not to open the file separately
just to determine what the BOM is.
Is it possible to open for appending with CCS=UTF-8 and then determine
what the existing coding is? Then if the existing is wrong I can close
the file and convert it. This way I'm only doing the extra effort if the
file actually needs conversion.
I think the existing encoding is stored in the FILE structure. Is this
documented anywhere?
Thanks,
++PLS