Adding an encoding order constant and changing the default order so that UTF-8 is first.