tags:

views:

35

answers:

1

I have source code with an encoding different then my system's default encoding for non-Unicode application.

For example my machine is default to Windows 1255, but the code I am trying to build is in Windows 1252 encoding.

Is there a way to set the MSbuild encoding to a specific encoding for a specific build?

This is a machine that does multiple build for files in multiple different encodings.

+2  A: 

The C# compiler is fully unicode aware - what problems are you having specifically? It is generally fairly rare for actual source code to contain large amounts of non-ASCII anyway.

But I suspect the simplest thing in your case would be to change the files to UTF8... no more problem. It would be pretty easy to script loading it with a specific Encoding and then saving with Encoding.UTF8.

Marc Gravell
I know, but still it is common to save source files in non unicode encoding.Regarding the source code, I have source code from many customers from many countries - with their specific languages - so some time a string literal will hold text in hebrew, sometimes in french, and other in polish (if that's how you pronounce it)
Noam
@Noam - noted, but I still think that changing all to UTF8 is going to be your simplest option.
Marc Gravell
I see, The problem is that I send these source files to my customers, and that would seem to them non standard
Noam
I would consider UTF8 pretty standard...
Marc Gravell