Joakim;8530 wrote:
Edit:
I tested a few more things and noticed that the projects that fails to build will build as long as the files affected in each project is open in visual studio.
Close any of the affected files and the project that the file belongs to fails to build.
This makes sense. When the file isn't open in VS, NCrunch can just straight copy the file from disk in whatever encoding it happens to be.
When the file is open in VS, NCrunch needs to obtain the file content from VS itself rather than the file. In this situation, there is no information available about the encoding of the text in the file. To work around this, NCrunch tries to auto-detect the encoding by reading the file on disk, then writing the data from VS into the workspace using the detected encoding. There is no way this can ever be 100%, but it catches almost every case. You've managed to find a situation where the encoding for some reason isn't being detected correctly or the text provided by VS isn't encoded the way it should be. In either case, I'll need to get a sample that can reproduce the problem so that I can recreate it and assess our options.
One way you may be able to limit the impact of the problem is by moving the Japanese text into a separate source file, away from the rest of your code. In this way, you can leave the file closed while you work so NCrunch doesn't need to try and obtain its data from VS.