cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Soref <>
Subject Unicode and XML files
Date Tue, 26 Nov 2013 15:31:37 GMT

I have three pull requests which I haven’t actually submitted:
BlackBerry [1], Cli [2], Plugman [3]

Windows for historical reasons doesn’t default to treating text files as UTF-8. Instead
files are typically treated as Latin-1 or some other random historical encoding. If you want
a file to be treated by your typical Windows program as UTF-8, you are expected to insert
the UTF-8 version of the Unicode BOM at the start of the file.

Per ConfigurationFiles [4], CLI and Plugman take a user authored config.xml and generate a
platform one (actually, the documentation there claims that only Plugman does so, but my work
[2] indicates that CLI also does so occasionally…). That file is then used by platform code
[1] and it could also be opened by the user (when there’s a problem).

Since Windows editors (including Eclipse on Windows [5]…) don’t use UTF-8 by default,
the results can be fairly random or at least inconsistent with expectations.

I’m not absolutely certain that I like my patch set, I could probably get away with only
doing [1], but it feels like the right behavior for a parser would be to honor the input format
when producing output, I.e. If there were a BOM in the user’s config.xml, produce a BOM
in the generated one…



This transmission (including any attachments) may contain confidential information, privileged
material (including material protected by the solicitor-client or other applicable privileges),
or constitute non-public information. Any use of this information by anyone other than the
intended recipient is prohibited. If you have received this transmission in error, please
immediately reply to the sender and delete this information from your system. Use, dissemination,
distribution, or reproduction of this transmission by unintended recipients is not authorized
and may be unlawful.

View raw message