EncodingConverter Console Application

Here you can download a Windows console application that can be used to change the encoding of a text file. For example you can convert the content of a file that has an UTF encoding to an ANSI encoding.

How to use it:

  1. Download the application
  2. Open command prompt
  3. Launch the application passing the following arguments separated with a space:
    1. The path to the folder that contains the files to be converted. Example: C:\Files
    2. A file pattern (see the next link for details about the available wildcard characters http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/find_c_search_where.mspx?mfr=true). Example: *.csv
    3. The desired encoding. Example: ANSI

For example, let’s suppose that you’re calling the application passing the arguments: C:\Files *.csv ANSI (like in the image above). In this case, the application will convert to an ANSI encoding all the files with the extension .csv that are located under the folder C:\Files.

The complete list of available encodings can be found on MSDN.
You can see the same list by launching the console application with the command prompt and passing the argument: HELP
EncodingConverter HelpBelow is a list with the most common encodings that you can use:

Code Page Name Display Name
1200 utf-16 Unicode
1201 unicodeFFFE Unicode (Big endian)
1250 windows-1250 Central European (Windows)
1251 windows-1251 Cyrillic (Windows)
1252 Windows-1252 Western European (Windows)
1253 windows-1253 Greek (Windows)
1254 windows-1254 Turkish (Windows)
1255 windows-1255 Hebrew (Windows)
1256 windows-1256 Arabic (Windows)
1257 windows-1257 Baltic (Windows)
1258 windows-1258 Vietnamese (Windows)
12000 utf-32 Unicode (UTF-32)
12001 utf-32BE Unicode (UTF-32 Big endian)
20127 us-ascii US-ASCII
65000 utf-7 Unicode (UTF-7)
65001 utf-8 Unicode (UTF-8)

Finally, if you want to see the source code, you can find it at http://encodingconverterconsoleapplication.codeplex.com/


ASP.NET view state decoders

Lately I had to optimize some pages so I needed to see what’s inside that ugly, evil view state. Fortunately there’s a bunch of free tools already available, so I’ll just make a short list of the ones I liked the most.

  1. Ignatu.co.uk – Online view state decoder
  2. The already famous ViewState Decoder by Fritz Onion from Pluralsight
  3. ASP.NET ViewState Helper – from Binary Fortress Software – this one is a bit slow but has a great feature, it shows the percent of the views state in the total page size.
  4. ASP.NET ViewState Helper (Fiddler) – from Binary Fortress Software – just a simple but useful extension for Fiddler2.
  5. ViewState Decoder Add-On for Firefox

Another great but also expensive tool is Burp Proxy. It can be used to intercept and change anything that’s sent/received via HTTP not only the view state and this makes it a handy security test tool.

Before trying to use any of these tools, check your web.config and make sure that the view state is not encrypted and/or chunked.

<?xml version="1.0"?>
        <pages viewStateEncryptionMode="Never"> 
        <!-- When testing make sure to remove view state chunking (attribute
             from the pages tag) -->