Merge pull request #136 from dotnet/master

Manual publish fixing bad squash-merge
This commit is contained in:
Andy De George
2020-11-24 10:34:28 -08:00
committed by GitHub
11 changed files with 197 additions and 64 deletions
@@ -11,21 +11,23 @@ helpviewer_keywords:
ms.assetid: a57776d1-f353-4794-afa0-bfa3c712ed1c
---
# How to: Use Special Characters in XAML
Markup files that are created in Visual Studio are automatically saved in the Unicode UTF-8 file format, which means that most special characters, such as accent marks, are encoded correctly. However, there is a set of commonly-used special characters that are handled differently. These special characters follow the World Wide Web Consortium (W3C) XML standard for encoding.
The following table shows the syntax for encoding this set of special characters:
|Character|Syntax|Description|
|---------------|------------|-----------------|
|<|`&lt;`|Less than symbol.|
|>|`&gt;`|Greater than sign.|
|&|`&amp;`|Ampersand symbol.|
|"|`&quot;`|Double quote symbol.|
Markup files that are created in Visual Studio are automatically saved in the Unicode UTF-8 file format, which means that most special characters, such as accent marks, are encoded correctly. However, there is a set of commonly-used special characters that are handled differently. These special characters follow the World [Wide Web Consortium (W3C) XML standard for encoding](https://www.w3resource.com/xml/reserved-markup-characters.php).
The following table shows the syntax for encoding this set of special characters:
| Character | Syntax | Description |
|-----------|----------|----------------------|
| `<` | `&lt;` | Less than symbol. |
| `>` | `&gt;` | Greater than sign. |
| `&` | `&amp;` | Ampersand symbol. |
| `"` | `&quot;` | Double quote symbol. |
| `'` | `&apos;` | Single quote symbol. |
> [!NOTE]
> If you create a markup file using a text editor, such as Windows Notepad, you must save the file in the Unicode UTF-8 file format in order to preserve any encoded special characters.
The following example shows how you can use special characters in text when creating markup.
## Example
[!code-xaml[SpecialCharsSnippets#SpecialCharsSnippet1](~/samples/snippets/csharp/VS_Snippets_Wpf/SpecialCharsSnippets/CS/Window1.xaml#specialcharssnippet1)]
> If you create a markup file using a text editor, such as Windows Notepad, you must save the file in the Unicode UTF-8 file format in order to preserve any encoded special characters.
The following example shows how you can use special characters in text when creating markup.
## Example
[!code-xaml[SpecialCharsSnippets#SpecialCharsSnippet1](~/samples/snippets/csharp/VS_Snippets_Wpf/SpecialCharsSnippets/CS/Window1.xaml#specialcharssnippet1)]