PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 12:36 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri Mar 20, 2009 12:47 pm 
Offline

Joined: Fri Mar 20, 2009 12:39 pm
Posts: 5
hundreds of error CS1010: Newline in constant and error CS1012: Too many characters in character literal happened when compiling PDFSharp library. My IDE is vs2008. It seems like it is those unicode character in Chars.cs, XColorResourceManager.cs and PdfDictionary.cs cause this problem. But I don't know how to fix it. Can somebody please help me?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 20, 2009 2:02 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
I just checked "XColorResourceManager.cs": it contains no unicode characters. VS2008 shows encoding as "1252" and it compiles correctly.

Which encoding does your VS show for XColorResourceManager.cs?

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: About the encoding
PostPosted: Fri Mar 20, 2009 4:36 pm 
Offline

Joined: Fri Mar 20, 2009 12:39 pm
Posts: 5
I don't know. But it's got be a problem of encoding cause there are some very strange characters in the file. And I don't know how to check the current encoding of the file or how to change the encoding of the file in VS. Can you tell me? Forgive my lack of knowledge and experience.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 20, 2009 5:03 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Open the file in VS 2008 and look at File => Advanced Save Options.

These .cs files are plain text files (they have no encoding).
I presume the default encoding of your computer is used. Default should be 1252 in the western world, therefore it works for many people.
If the files had the correct UTF encoding it should work for all people (that is our mistake).

I can send you UTF-encoded versions of those files if you send me your e-mail address via PM.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Mar 23, 2009 8:03 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
You should be able to correct the problem yourself:
When you select File -> Open -> File... in VS 2008, there is a small triangle (pointer) beside the Open button.
Select Open With from the menu, then select CSharp Editor with Encoding.

The files that cause problems will all open with "Western European (Windows) - Codepage 1252".

Then select File -> Advanced Save Options and select "Unicode (UTF-8 with signature) - Codepage 65001" and click OK.

The default setting for opening files is "auto detect". Maybe there's something different in your operating system that affects how this auto detection works.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 356 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group