Previous implementation doesn't take care of overlong encoding Signed-off-by: Xiaokang Qin <xiaokang.qxk@antgroup.com>