How to specify the encoding for an embedded ressource

L

Lucas Bernard

Hi,

[environment]
Visual Studio 2005
C#

[situation]
In a Class Library project, I have a file (MyScript.sql) containing T-SQL
statements.
The Build Action property of this file is set to "Embedded resource".
In this project, I have a small piece of code whose job is to read the
MyScript file and to execute each sql query.
In a Web Setup project, I have a custom action which access the previous
library.

[problem description]
One of my SQL query looks like this: INSERT INTO ... VALUES ("Mésange").
Unfortunately, once compiled, it is modified to: INSERT INTO ...
VALUES("M?sange").

[my unsuccessful tests]
In the AssemblyInfo.cs of the Library, I have tried different values for
AssemblyCulture(). For example AssemblyCulture("fr").
I have tried to save the file MyScript.sql with different encodings (like
Unicode, UTF8, ....).

[question]
How could I inform Visual Studio to build the dll with the embedded resource
and preserve it's encoding?

Thanks for your time and your answer.
Bernard Lucas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top