Connecting Tech Pros Worldwide Forums | Help | Site Map

Is it possible to use a special character in a code snippet?

forest demon
Guest
 
Posts: n/a
#1: Sep 16 '08
i've been trying to create a code snippet that would contain a special
character...i.e. a trademark symbol (™).

but to no avail. whether in the CDATA section or a literal
definition, no workie!

anyone know if there's a way around this?

thanks folks...

-
FD

Anthony Jones
Guest
 
Posts: n/a
#2: Sep 16 '08

re: Is it possible to use a special character in a code snippet?


"forest demon" <mete.hanap@gmail.comwrote in message
news:9dee634b-8eb5-44e9-b9a4-76a289be5aab@73g2000hsx.googlegroups.com...
i've been trying to create a code snippet that would contain a special
character...i.e. a trademark symbol (™).

but to no avail. whether in the CDATA section or a literal
definition, no workie!

anyone know if there's a way around this?

thanks folks...
Quote:
Quote:
Quote:
>>>>>>>>>>>>>>>>
Can you show us some code that is failing, if you just have that in a string
there is no reason it should fail.

--
Anthony Jones - MVP ASP/ASP.NET

forest demon
Guest
 
Posts: n/a
#3: Sep 16 '08

re: Is it possible to use a special character in a code snippet?


On Sep 16, 2:12 pm, "Anthony Jones" <AnthonyWJo...@yadayadayada.com>
wrote:
Quote:
"forest demon" <mete.ha...@gmail.comwrote in message
>
news:9dee634b-8eb5-44e9-b9a4-76a289be5aab@73g2000hsx.googlegroups.com...
i've been trying to create a code snippet that would contain a special
character...i.e. a trademark symbol (™).
>
but to no avail. whether in the CDATA section or a literal
definition, no workie!
>
anyone know if there's a way around this?
>
thanks folks...
>
>
>
Can you show us some code that is failing, if you just have that in a string
there is no reason it should fail.
>
--
Anthony Jones - MVP ASP/ASP.NET
thanks for the reply anthony...

down in the CDATA section, you'll see BLAH™
i can't get it to work. and if i remove the TradeMark symbol, it works
fine.

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/
CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>
Class Header
</Title>
<Description>
Inserts class header requirements specific to Company, Inc
development
</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>trademark</ID>
<Default></Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[#region Copyright
/// Copyright Company, Inc.
///
/// This program is protected under Patent Pending Filings with the
State of Illinois,
/// and is not an open-source code base. No utilization of said
codebase nor program
/// may be utilized unless express consent has been placed by
Company, Inc.
/// BLAH™ is a trademark owned by Company, Inc. Any attempts to harm
the efforts
/// represented by this and all other vested interests of this
company, whether direct
/// or indirect, will be aggressively prosecuted to the fullest
extent of the law.
/// All Rights Reserved.
#endregion
$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>

Anthony Jones
Guest
 
Posts: n/a
#4: Sep 16 '08

re: Is it possible to use a special character in a code snippet?


"forest demon" <mete.hanap@gmail.comwrote in message
news:80e0ed6e-ae3c-44ec-bd7c-887527b8749a@w7g2000hsa.googlegroups.com...
On Sep 16, 2:12 pm, "Anthony Jones" <AnthonyWJo...@yadayadayada.com>
wrote:
Quote:
"forest demon" <mete.ha...@gmail.comwrote in message
>
news:9dee634b-8eb5-44e9-b9a4-76a289be5aab@73g2000hsx.googlegroups.com...
i've been trying to create a code snippet that would contain a special
character...i.e. a trademark symbol (™).
>
but to no avail. whether in the CDATA section or a literal
definition, no workie!
>
anyone know if there's a way around this?
>
thanks folks...
>
>
>
Can you show us some code that is failing, if you just have that in a
string
there is no reason it should fail.
>
--
Anthony Jones - MVP ASP/ASP.NET
thanks for the reply anthony...

down in the CDATA section, you'll see BLAH™
i can't get it to work. and if i remove the TradeMark symbol, it works
fine.

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/
CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>
Class Header
</Title>
<Description>
Inserts class header requirements specific to Company, Inc
development
</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>trademark</ID>
<Default></Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[#region Copyright
/// Copyright Company, Inc.
///
/// This program is protected under Patent Pending Filings with the
State of Illinois,
/// and is not an open-source code base. No utilization of said
codebase nor program
/// may be utilized unless express consent has been placed by
Company, Inc.
/// BLAH™ is a trademark owned by Company, Inc. Any attempts to harm
the efforts
/// represented by this and all other vested interests of this
company, whether direct
/// or indirect, will be aggressively prosecuted to the fullest
extent of the law.
/// All Rights Reserved.
#endregion
$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Quote:
Quote:
Quote:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The xml declare indicates the file has a UTF-8 encoding, are you sure the
file is saved as UTF-8. Open it in notepad and select save as... I suspect
it says ANSI, change it to UTF-8 and save.

--
Anthony Jones - MVP ASP/ASP.NET

forest demon
Guest
 
Posts: n/a
#5: Sep 16 '08

re: Is it possible to use a special character in a code snippet?


On Sep 16, 3:16 pm, "Anthony Jones" <AnthonyWJo...@yadayadayada.com>
wrote:
Quote:
"forest demon" <mete.ha...@gmail.comwrote in message
>
news:80e0ed6e-ae3c-44ec-bd7c-887527b8749a@w7g2000hsa.googlegroups.com...
On Sep 16, 2:12 pm, "Anthony Jones" <AnthonyWJo...@yadayadayada.com>
wrote:
>
>
>
Quote:
"forest demon" <mete.ha...@gmail.comwrote in message
>
Quote:
news:9dee634b-8eb5-44e9-b9a4-76a289be5aab@73g2000hsx.googlegroups.com...
i've been trying to create a code snippet that would contain a special
character...i.e. a trademark symbol (™).
>
Quote:
but to no avail. whether in the CDATA section or a literal
definition, no workie!
>
Quote:
anyone know if there's a way around this?
>
Quote:
thanks folks...
>
Quote:
Can you show us some code that is failing, if you just have that in a
string
there is no reason it should fail.
>
Quote:
--
Anthony Jones - MVP ASP/ASP.NET
>
thanks for the reply anthony...
>
down in the CDATA section, you'll see BLAH™
i can't get it to work. and if i remove the TradeMark symbol, it works
fine.
>
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/
CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>
Class Header
</Title>
<Description>
Inserts class header requirements specific to Company, Inc
development
</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>trademark</ID>
<Default></Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[#region Copyright
/// Copyright Company, Inc.
///
/// This program is protected under Patent Pending Filings with the
State of Illinois,
/// and is not an open-source code base. No utilization of said
codebase nor program
/// may be utilized unless express consent has been placed by
Company, Inc.
/// BLAH™ is a trademark owned by Company, Inc. Any attempts to harm
the efforts
/// represented by this and all other vested interests of this
company, whether direct
/// or indirect, will be aggressively prosecuted to the fullest
extent of the law.
/// All Rights Reserved.
#endregion
$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
>
>
>
The xml declare indicates the file has a UTF-8 encoding, are you sure the
file is saved as UTF-8. Open it in notepad and select save as... I suspect
it says ANSI, change it to UTF-8 and save.
>
--
Anthony Jones - MVP ASP/ASP.NET
you were absolutely right! after saving in the appropriate format, it
works fine.

thanks anthony, i appreciate your time.

-
FD
Closed Thread


Similar .NET Framework bytes