Confirmed. Encoding class will easily convert from ISO-2022-xx to Unicode.
Here's a code snippit demonstrating the basic operation: (note: second
attempt to post. First attempt ended up in some indeterminant failure wherein
IE was hung)
namespace TestIsoToUnicode
{
class Program
{
static void Main(string[] args)
{
// Starting string, a name of a file in Japanese as expressed in
ISO-2022-JP
char[] stringInJpnIsoEncoding = new char[] {
(char)0x1b, (char)0x24, (char)0x42, (char)0x25, (char)0x22,
(char)0x25,
(char)0x2f, (char)0x25, (char)0x3b, (char)0x25, (char)0x39,
(char)0x38,
(char)0x22, (char)0x43, (char)0x2a, (char)0x32, (char)0x37,
(char)0x24,
(char)0x37, (char)0x34, (char)0x30, (char)0x4e, (char)0x3b,
(char)0x4a,
(char)0x73, (char)0x1b, (char)0x28, (char)0x42, (char)0x1b,
(char)0x24,
(char)0x42, (char)0x39, (char)0x70, (char)0x3d, (char)0x71,
(char)0x1b,
(char)0x28, (char)0x42, (char)0x2e, (char)0x64, (char)0x6f,
(char)0x63,
(char)0x00 };
// Conversion requires in input format and output format
specifier.
// This is the source format object.
Encoding jpnEncoding = Encoding.GetEncoding(50220);
byte[] convertedToUnicode = Encoding.Convert(
jpnEncoding, // Src format
Encoding.Unicode, // Dst format
jpnEncoding.GetBytes(stringInJpnIsoEncoding)); //
Dst for data
// Turn Unicode formated data's byte array into a string object.
string strUni = Encoding.Unicode.GetString( convertedToUnicode );
}
}
}