Closed akberc closed 10 years ago
I don't understand - quotes are regular ASCII characters, they're the same in almost every encoding.
What exactly was your problem? Did you run the formatter standalone or from the IDE?
From command line. Using Java 8 and Ant 1.9.4. On clean machines (both XP and Win7):
ant clean publish
in ceylon.formatter
I will try to find the cause and see if I can fix it.
Sorry for the picture, no easy way to copy text from DOS Window:
Oh, I see. Not a problem with formatted code, a compilation error! Because I like to use “this” and ‘these’ instead of "this" and 'these'.
IIRC the same problem popped up in ceylon-dist (by
“Stéphane Épardaud”), and it can be fixed by declaring the encoding in the build.xml
. Let me see…
Hm, we are declaring an encoding of UTF-8. Maybe the Ceylon compiler doesn’t tell javac
the encoding?
Can you run ceylon compile
and see if you still get errors?
Or (but that would be incredibly silly), could you try replacing “UTF-8” with “UTF8” in the build.xml
?
@lucaswerkmeister On Windows the generated files are not valid UTF8, it has nothing to do with Javac.
Actually the scheme you use to generate the files uses the default encoding of the OS, instead of UTF8. So on Windows you use CP1252.
I know because :
1) I can make it work if i set set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
in my Windows shell
2) Without the workaround, the faulty quotes shows up as x92
in an UTF8 editor, and indeed this is invalid UTF8. In the attached screen shoot, this is how it looks like in notepad++ for instance
Oh, I have to set the Writer
encoding? Okay.
Can you try out if the fix60
branch works?
Yes, indeed, fix60
branch works. Thanks !
Great, I pushed it to master
. Thanks!
Thank you.
A minor note: ant clean does not remove the generated files in source\ceylon\formatter\options
The generated sources encoding for characters
'
and"
may be incorrect UTF-8, at least on Windows.