Correctly set the "from" encoding type when converting text encodings
Added named constants for UTF8 and UTF16