views:

38

answers:

2

Hello, I am working on a asp.net 3.5 project in sweden, where some of the namespaces include swedish characters, such as 'å', 'ä' and 'ö'. When building the project and generating the design-file, visual studio replaces these characters with some other strange characters. This only happens when the characters occur in a namespace or class name. If a field or variable contain a swedish character, everything works fine. To clarify, the strange character occur in the design file when a namespace and/or control contain swedish characters. Does anyone know why this happens and if there is a solution for the problem that doesn't mean changing the names of the namespaces?

Sincerely, Fredrik

A: 

Do you use Resharper? I heard of Resharper changing file encoding in some cases.

Mr.Cat
Yes, but this problem occurs for other developers in our project as well, and they don't use ReSharper.
Fredrik
+2  A: 

When you put international characters in the source code, Visual Studio automatically changes the encoding of the file so that it can handle the characters. Obviously it doesn't change the encoding automatically for the auto generated file.

You don't mention what the actual problem is, i.e. whether this keeps the code from compiliing or if it's just an inconvenience that the namespaces change. If the code is still working, then it's probably just a problem with how the design file is displayed, and doesn't really have to be fixed.

If the code doesn't compile, you could try saving the design file as UTF-8, and see if it retains the encoding when the code is regenerated.

If that doesn't work, I don't see any other solution than changing the namespaces.

Guffa
The problem is that it causes compile errors, since visual studio is replacing the swedish characters with some that are not allowed. I replied recently that saving the file as UTF-8 solved the problem, but this was probably premature. The problem still remains. Therefore, I deleted my previous comment.
Fredrik