MSBUILD and ASCII Copyright

F

Flomo Togba Kwele

Is there a way to create a copyright symbol as output? I've tried and haven't been able to.


<AssemblyInfo CodeLanguage="VB"
OutputFile=".\AssemblyInfo.vb"
AssemblyTitle="App"
AssemblyDescription="App Description"
AssemblyCompany="Company Name"
AssemblyProduct="App"
AssemblyCopyright="Copyright %169 Company Name 2007"
....
/>

Thanks, Flomo
--
 
J

Jon Skeet [C# MVP]

Flomo Togba Kwele said:
Is there a way to create a copyright symbol as output?
I've tried and haven't been able to.


<AssemblyInfo CodeLanguage="VB"
OutputFile=".\AssemblyInfo.vb"
AssemblyTitle="App"
AssemblyDescription="App Description"
AssemblyCompany="Company Name"
AssemblyProduct="App"
AssemblyCopyright="Copyright %169 Company Name 2007"
...
/>

If it's in an XML file, you need an XML escape:

AssemblyCopyright="Copyright © Company Name 2007"

I haven't tried that, but I'd expect it to work.

(Point of quibbling - there's no ASCII copyright symbol. ASCII doesn't
include any characters of Unicode > 127.)
 
F

Flomo Togba Kwele

Thanks for the tip, Jon, but it doesn't like those characters.

error MSB4025: The project file could not be loaded. Invalid syntax for a decimal numeric entity
reference.

I thought the escape character for an MSBuild file was '%', that's why I tried it. It output a hex
16 character for the sequence %169.

Flomo
 
J

Jon Skeet [C# MVP]

Flomo Togba Kwele said:
Thanks for the tip, Jon, but it doesn't like those characters.

error MSB4025: The project file could not be loaded. Invalid syntax
for a decimal numeric entity reference.

Hmm. Odd.
I thought the escape character for an MSBuild file was '%', that's
why I tried it. It output a hex
16 character for the sequence %169.

Well, the version I gave was just the generic way of doing it in XML -
not MS Build specific.

Have you tried just inserting the copyright sign directly into the file
and saving it in UTF-8?
 
F

Flomo Togba Kwele

Yes, I did.

AssemblyCopyright="Copyright © Company Name 2007"

error MSB4025: The project file could not be loaded. Invalid character in the given encoding.
 
J

Jon Skeet [C# MVP]

Flomo Togba Kwele said:
Yes, I did.

AssemblyCopyright="Copyright © Company Name 2007"

error MSB4025: The project file could not be loaded. Invalid
character in the given encoding.

Did you specify the encoding at the start of the file, and are you sure
you saved it *using* that encoding?
 
F

Flomo Togba Kwele

Yes, it was already there.
<?xml version="1.0" encoding="utf-8"?>


However, the MSBuild file itself was encoded ANSI, not UTF-8. When I changed it and re-ran the
script, no error!

Thanks so much, Jon.
 
J

Jon Skeet [C# MVP]

Flomo Togba Kwele said:
Yes, it was already there.
<?xml version="1.0" encoding="utf-8"?>

However, the MSBuild file itself was encoded ANSI, not UTF-8. When I
changed it and re-ran the script, no error!

Thanks so much, Jon.

No problem. I'm still intrigued as to what's wrong with using the
numeric version though. If I ever get time, I'll have a look - it's
unlikely that I *will* get the time though :(
 

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

Top