Groups | Blog | Home
all groups > dotnet framework > may 2007 >

dotnet framework : MSBUILD and ASCII Copyright



Flomo Togba Kwele
5/30/2007 11:03:45 AM
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
--
Flomo Togba Kwele
5/30/2007 4:06:58 PM
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
--



[quoted text, click to view]
Flomo Togba Kwele
5/30/2007 4:58:35 PM
Yes, I did.

AssemblyCopyright="Copyright © Company Name 2007"

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



[quoted text, click to view]
Flomo Togba Kwele
5/30/2007 5:28:24 PM
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.
--



[quoted text, click to view]
Jon Skeet [C# MVP]
5/30/2007 7:33:10 PM
[quoted text, click to view]

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

AssemblyCopyright="Copyright &#169; 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.)

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
Jon Skeet [C# MVP]
5/30/2007 10:25:24 PM
[quoted text, click to view]

Hmm. Odd.

[quoted text, click to view]

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?

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
Jon Skeet [C# MVP]
5/30/2007 11:13:00 PM
[quoted text, click to view]

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

--=20
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
Jon Skeet [C# MVP]
5/30/2007 11:35:54 PM
[quoted text, click to view]

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 :(

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
AddThis Social Bookmark Button