Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roslyn failed to build itself under system codepage 936 #5413

Closed
pawchen opened this issue Sep 23, 2015 · 6 comments
Closed

Roslyn failed to build itself under system codepage 936 #5413

pawchen opened this issue Sep 23, 2015 · 6 comments

Comments

@pawchen
Copy link
Contributor

pawchen commented Sep 23, 2015

I was building Roslyn with cibuild.cmd, this error happened when the bootstrapped compiler compiles a test project

My system locale is Simplified Chinese/CodePage936/GB2312, from cmd invoke cibuild.cmd failed to build the following file:

src\EditorFeatures\VisualBasicTest\Diagnostics\GenerateType\GenerateTypeTests.vb(695,114)
...
src\EditorFeatures\VisualBasicTest\Diagnostics\GenerateType\GenerateTypeTests.vb(724,6)

When I used NotePad++ to open this file, I saw
garbage

Then I changed encoding to UTF-8 Without BOM
0xA0

When I use some Charset from European the content looks correct.
correct

pawchen added a commit to pawchen/roslyn that referenced this issue Sep 23, 2015
@Pilchie
Copy link
Member

Pilchie commented Sep 23, 2015

Tagging @jaredpar who has looked at some encoding issues before.

@jaredpar
Copy link
Member

Thanks for reporting. This is a duplicate of #4264. This has already been fixed and will be included in update 1.

In the mean time you can work around this by adding the following entry int your vbproj file:

<CodePage>936</CodePage>

This will override the encoding detection logic to prefer this encoding instead of the standard fall back mechanisms.

@jaredpar jaredpar added the Resolution-Duplicate The described behavior is tracked in another issue label Sep 23, 2015
@pawchen
Copy link
Contributor Author

pawchen commented Sep 24, 2015

@jaredpar No, I don't think this is duplicate. I was compiling Roslyn. The cibuild.cmd bootstrap itself then use the new compiler to compile Roslyn, if it's fixed then this won't happen.

The issue you referred was about building files with encoding X under system code page X, while this issue is about building files with encoding X under system code page Y. Unfortunately there's no reasonable fix for a compiler if the files were from external project but to fix the external project source file, but fortunately & interestingly the files are from Roslyn itself, so the fix would be fix that "external" project source file which is from the Roslyn itself.

Converting the file encoding into UTF-8 is the correct way, which is what my PR #5415 is doing.

@pawchen pawchen changed the title Weird encoding within source file Roslyn failed to build under system codepage 936 Sep 24, 2015
@pawchen pawchen changed the title Roslyn failed to build under system codepage 936 Roslyn failed to build itself under system codepage 936 Sep 24, 2015
@dpoeschl
Copy link
Contributor

Reopening on @DiryBoy's behalf for now and removing Resolution-Duplicate, as per #5424.

@jaredpar If you still believe this to be a duplicate and find me reopening this to be annoying, please chime in on the #5424 discussion. 😄

@dpoeschl dpoeschl reopened this Sep 24, 2015
@dpoeschl dpoeschl removed the Resolution-Duplicate The described behavior is tracked in another issue label Sep 24, 2015
@jaredpar
Copy link
Member

@DiryBoy @dpoeschl ah okay. I misread the original bug report.

@pawchen
Copy link
Contributor Author

pawchen commented Sep 24, 2015

@jaredpar I didn't explain the issue well earlier, apology for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants