Fix Unicode support to cope with Javascript Unicode size limitations