encoding.c (enc_table_expand): prefer xrealloc to realloc
And raise an exception when failed to register an encoding
encoding.c (enc_table_expand): prefer xrealloc to realloc
And raise an exception when failed to register an encoding