Minor changes to 5 bit encode function

More explicit char comparisons rather than implicit conversions to
their int equivalents