>I'm a bit puzzled here. The need for the prefix depends on the application that will consume the file. Some may require it, others will just consider it and others still may nag at it. Perhaps this is a case in which the prefix is mandatory. Nevertheless, by UNICODE standards the BMO in UTF-8 files is optional - which is quite understandable - and I have yet to find an XML parser or editor that will not comply with the encoding stated in the XML declaration (that's the purpose of it!).
>
>In any case, shouldn't the prefix be left out of the STRCONV()? Otherwise, it will be converted to UTF-8 also, thus failing the intended goal of signaling the file encoding.
Yes - and that's where I intended to put it, but I put my mouse in the wrong place.
And you're right, it depends on the consumer of the string. If you want an UTF-8 text file, to be recognized as such by pretty much any editor capable of doing so, then you need the prefix. For other kinds of files, and Unicode strings in other contexts (web pages, xml format messages between apps etc), there are other headers.