John,
All of the files are 7-bit clean ASCII.
There are no extended characters.
Since this is an XML document, the client has requested that the file be in
UTF-8 encoding.

Your comments are directly on target and clearly explain the issue I am
having.
I will be trying Scott's suggestion of adding a BOM as the first record in
the file, but still do not understand why the first file shows in Notepad
as UTF-8 and all others show as ANSI.

Thanks,



On Mon, Jun 25, 2012 at 10:37 AM, John Yeung <gallium.arsenide@xxxxxxxxx>wrote:

I'm trying to convey to you that, despite being coded as either UTF-8 or
Windows-1252 in the program, the binary image of the file might be
identical, and therefore there's no way for Notepad to tell which one it
is -- thus producing the symptom that Jeff described, where he creates
the file as UTF-8, and Notepad detects it to be Windows-1252.

According to his post, the first file generated is reliably considered
UTF-8 by Notepad, while the rest are reliably considered ANSI. If
there is no detectable difference, then why wouldn't it always be one
or the other, or at least random?

This is why it seemed to me (perhaps mistakenly so) that you were not
reading carefully enough.

A more helpful diagnosis of the symptoms described might be: Assuming
Notepad chooses the "simpler" encoding where possible (a guess on my
part; I have not confirmed this), and assuming that all the characters
show up *as intended* in Notepad, then check the data to see if the
first file always has characters specific to UTF-8, whereas the
remaining files only have characters that are common to ANSI and
UTF-8, thus allowing Notepad to treat those files as ANSI.

If all the files generated are, say, 7-bit clean ASCII; or if some of
the 2nd through nth files have extended characters, then it is
certainly a mystery why Notepad would pick the first one to treat as
UTF-8 while the rest are treated as ANSI. To me, this would suggest
there is something about the files themselves which is prompting
Notepad to behave in the described way, which in turn would suggest
something about the program(s) generating the files.

John
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.