文档:https://developers.weixin.qq.com/minigame/dev/api/util/wx.encode.html。
小程序中没有提供这两个 API,小游戏定义 wechat-miniprogram/minigame-api-typings 是有的