add code_convert function and unittest ok