[HELP]Convert UTF-8 to GB2312 (or GBK)

I want to send some data to my TTS module via UART, but my module can only use GB2312 encoding.So how can I convert UTF-8 to GB2312?