RecognizeUtf8Text

RtfLoadOptions.RecognizeUtf8Text property

Cuando se establece enverdadero , intentará detectar caracteres UTF8, se conservarán durante la importación.

public bool RecognizeUtf8Text { get; set; }

Observaciones

El valor predeterminado esFALSO.

Ejemplos

Muestra cómo detectar caracteres UTF-8 al cargar un documento RTF.

// Crea un objeto "RtfLoadOptions" para modificar la forma en que cargamos un documento RTF.
RtfLoadOptions loadOptions = new RtfLoadOptions();

// Establezca la propiedad "RecognizeUtf8Text" en "falso" para asumir que el documento utiliza el juego de caracteres ISO 8859-1
// y carga cada carácter en el documento.
// Establezca la propiedad "RecognizeUtf8Text" en "verdadero" para analizar cualquier carácter de longitud variable que pueda aparecer en el texto.
loadOptions.RecognizeUtf8Text = recognizeUtf8Text;

Document doc = new Document(MyDir + "UTF-8 characters.rtf", loadOptions);

Assert.AreEqual(
    recognizeUtf8Text
        ? "“John Doe´s list of currency symbols”™\r" +
          "€, ¢, £, ¥, ¤"
        : "“John Doe´s list of currency symbolsâ€\u009dâ„¢\r" +
          "€, ¢, £, ¥, ¤",
    doc.FirstSection.Body.GetText().Trim());

Ver también