In a quick internet search, I hit on this SO post [1].  It seems to be
saying that Git does not enforce any particular character set when storing
files in the repo.  It also seems to be saying that there is lots of
Windows users who expect non-UTF-8 encoding.

In addition, I saw this SO post [2].

This means to me that the compiler is doing the right thing.  Products
with dozens of users are defaulting to Windows encodings on Windows, and
it is up to development teams that share files between Mac and Windows to
come up with their own solution.

It also means to me that we are highly exposed in how we share our files.
I think most of the major contributors have Macs, but anybody authoring or
editing a file on Windows has to be concerned about any characters in that
file that might have encoding issues.

So, for any of our users, we could add yet another compiler option to set
the encoding different from the system encoding in the case that someone
really wants them to be different, or we can just leave things as they are
in the code and maybe document how to use JAVA_TOOL_OPTIONS.  Note that
this issue was raised a while ago by folks in China.  It did not look
trivial to find all of the file reading/writing places and change the
classes they use to pick up a config option.

Then, for us, it appears that we have been exposed to this problem forever
and never really addressed it.  I think most of the major contributors
have Macs and we've been putting UTF-8 files into the repo, but anyone
using a Windows system has been at risk of putting in characters that
don't work on the Mac and having trouble reading and thus compiling files
that come from the repo.

We could require that everyone on Windows working on Royale code use a
UTF-8 editor.  I know I personally often just open up Notepad when fixing
Ant and Maven builds on Windows, but I guess I could switch.

Anybody have other ideas?
-Alex

[1] 
https://stackoverflow.com/questions/8038729/github-using-utf-8-encoding-for
-files
[2] 
https://stackoverflow.com/questions/33607828/how-to-change-the-default-defa
ult-encoding-in-eclipse

On 12/4/17, 1:19 AM, "Harbs" <[email protected]> wrote:

>
>The file in question was created by me on a Mac. An additional file which
>caused a problem on Yishay’s machine was StringTextLineFactory from TLF
>Lines 443, 445 and 446 (in the comment) were output as garbage characters
>by the Royale compiler without explicitly setting the encoding to UTF-8.
>
>A related issue is that unicode notation (i.e. \u2026)  is being
>evaluated and output as the actual unicode character which appears to be
>encoded wrong
>
>> On Dec 4, 2017, at 7:36 AM, Alex Harui <[email protected]> wrote:
>> 
>> 
>> 
>> On 12/3/17, 3:08 AM, "Yishay Weiss" <[email protected]> wrote:
>> 
>>> JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
>>> 
>>> Is there any reason not to hard code the file encoding in the compiler?
>>> 
>> I don't know for sure, but the first question that comes to mind is why
>> Java itself hasn't bothered to default to a particular file encoding.
>> 
>> Also, especially for folks using Windows, what kinds of editors do you
>>use
>> and what file encoding do those editors use?
>> 
>> My 2 cents,
>> -Alex
>> 
>

Reply via email to