Converts text from one encoding to another - must be used with Ajax since it doesn't support encodings other than utf-8.

Namespace: MonoSoftware.Core
Assembly: MonoSoftware.Core (in MonoSoftware.Core.dll) Version: 1.0.40.669 (1.0.40.669)

Syntax

C#
public static string ConvertToEncoding(
	this string textToConvert,
	Encoding src,
	Encoding dest
)
Visual Basic
<ExtensionAttribute> 
Public Shared Function ConvertToEncoding ( 
	textToConvert As String,
	src As Encoding,
	dest As Encoding
) As String
Visual C++
public:
[ExtensionAttribute]
static String^ ConvertToEncoding(
	String^ textToConvert, 
	Encoding^ src, 
	Encoding^ dest
)
F#
static member ConvertToEncoding : 
        textToConvert : string * 
        src : Encoding * 
        dest : Encoding -> string 

Parameters

textToConvert
Type: System..::..String
Text to convert
src
Type: System.Text..::..Encoding
Source encoding (e.g. Win-1250)
dest
Type: System.Text..::..Encoding
Destination encoding (e.g. UTF-8)

Return Value

Type: String
Converted encoded text

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also