Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2007

Tip: Looking for answers? Try searching our database.

MSBUILD and ASCII Copyright

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Flomo Togba Kwele - 30 May 2007 17:03 GMT
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
--
Jon Skeet [C# MVP] - 30 May 2007 19:33 GMT
> Is there a way to create a copyright symbol as output?
> I've tried and haven't been able to.
[quoted text clipped - 8 lines]
> ...
>       />

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.)

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Flomo Togba Kwele - 30 May 2007 22:06 GMT
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
Signature


> > Is there a way to create a copyright symbol as output?
> > I've tried and haven't been able to.
[quoted text clipped - 17 lines]
> (Point of quibbling - there's no ASCII copyright symbol. ASCII doesn't
> include any characters of Unicode > 127.)
Jon Skeet [C# MVP] - 30 May 2007 22:25 GMT
> 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?

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Flomo Togba Kwele - 30 May 2007 22:58 GMT
Yes, I did.

     AssemblyCopyright="Copyright © Company Name 2007"

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


> > Thanks for the tip, Jon, but it doesn't like those characters.
> >
[quoted text clipped - 12 lines]
> Have you tried just inserting the copyright sign directly into the file
> and saving it in UTF-8?
Jon Skeet [C# MVP] - 30 May 2007 23:13 GMT
> 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?

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Flomo Togba Kwele - 30 May 2007 23:28 GMT
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.
Signature


> > Yes, I did.
> >
[quoted text clipped - 5 lines]
> Did you specify the encoding at the start of the file, and are you sure
> you saved it using that encoding?
Jon Skeet [C# MVP] - 30 May 2007 23:35 GMT
> Yes, it was already there.
> <?xml version="1.0" encoding="utf-8"?>
[quoted text clipped - 3 lines]
>
> 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 :(

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.