Partilhar via


Como: Usar Caracteres Especiais em XAML

Markup files that are created in Microsoft 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. Esses caracteres especiais siga a World Wide Web Consortium (W3C) XML padrão de codificação.

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.

Observação

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.

Exemplo

<!-- Display special characters that require special encoding: < > & " -->
<TextBlock>
  &lt;    <!-- Less than symbol -->
  []    <!-- Greater than symbol -->
  &amp;   <!-- Ampersand symbol -->
  &quot;  <!-- Double quote symbol -->
</TextBlock>

<!-- Display miscellaneous special characters -->
<TextBlock>
  Cæsar   <!-- AE dipthong symbol -->
  © 2006  <!-- Copyright symbol -->
  Español <!-- Tilde symbol -->
  ¥       <!-- Yen symbol -->
</TextBlock>