StauffConsulting.Essentials.

CharEncoding

C#: 
public sealed abstract class CharEncoding :
    object

VB: 
Public NotInheritable MustInherit Class CharEncoding
    Inherits Object

Type Ancestry:  Object
+---CharEncoding


Routines for converting between ASCII, UNICODE, and XML entities.

Summary Info

Constructor Summary

Field Summary

Property Summary

Method Summary

Add Adds a character mapping.
Add
EntitiesToAscii Converts (some) entities in the given string to reasonable ASCII equivalents.
EntitiesToUnicode Converts any entities in a given string into their Unicode equivalents.
RemoveUnicode Removes a character mapping.
ToCsharpLiteral Converts a string to its C# string literal representation.
UnicodeToAscii Converts (some) non-ASCII characters in the given Unicode string to reasonable ASCII equivalents.
UnicodeToEntities Converts to entities any Unicode characters in the given string that have an entity representation.

Miscellany Summary

Method Details


Add

C#: 
static Void Add(string entity,
    string unicode,
    string ascii)

VB: 
Shared Function Add(ByVal entity As String, ByVal [unicode] As String, ByVal ascii As String) As Void

Adds a character mapping.

Parameters

entity   may be null; otherwise must begin with an ampersand and end with a semicolon
unicode   usually 1 character; may be null
ascii   usually 1 character; may be null


Add

C#: 
static Void Add(string namedEntity,
    string decimalEntity,
    string hexEntity,
    string unicode,
    string ascii)

VB: 
Shared Function Add(ByVal namedEntity As String, ByVal decimalEntity As String, ByVal hexEntity As String, ByVal [unicode] As String, ByVal ascii As String) As Void

Parameters

namedEntity  
decimalEntity  
hexEntity  
unicode  
ascii  


EntitiesToAscii

C#: 
static String EntitiesToAscii(string input)

VB: 
Shared Function EntitiesToAscii(ByVal input As String) As [String]

Converts (some) entities in the given string to reasonable ASCII equivalents.

Parameters

input  


EntitiesToUnicode

C#: 
static String EntitiesToUnicode(string input)

VB: 
Shared Function EntitiesToUnicode(ByVal input As String) As [String]

Converts any entities in a given string into their Unicode equivalents.

Parameters

input  


RemoveUnicode

C#: 
static Void RemoveUnicode(string entity,
    char unicode)

VB: 
Shared Function RemoveUnicode(ByVal entity As String, ByVal [unicode] As Char) As Void

Removes a character mapping.

Parameters

entity  
unicode  


ToCsharpLiteral

C#: 
static String ToCsharpLiteral(string input)

VB: 
Shared Function ToCsharpLiteral(ByVal input As String) As [String]

Converts a string to its C# string literal representation. The returned string is enclosed in double-quotes, with "funny" characters escaped. If the input is null, the return value is "null" (without the quotes).

Parameters

input  


UnicodeToAscii

C#: 
static String UnicodeToAscii(string input)

VB: 
Shared Function UnicodeToAscii(ByVal input As String) As [String]

Converts (some) non-ASCII characters in the given Unicode string to reasonable ASCII equivalents.

Parameters

input  


UnicodeToEntities

C#: 
static String UnicodeToEntities(string input)

VB: 
Shared Function UnicodeToEntities(ByVal input As String) As [String]

Converts to entities any Unicode characters in the given string that have an entity representation.

Parameters

input  


generated by DocGenDotNet on 18 Nov 2008 6:35:01 PM