账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    python3 execjs 执行js代码, 代码里有中文和转义符就报错
    21
    0

    麻烦大神给看下谢谢

    jss = """
    var apps =[
      {
        "id": "13970",
        "uid": "193586",
        "title": "\u8fd0\u52a8\u6b65\u6570\u5b9d\u6b65\u6b6",
        "price": "1620.00",
        "price_max": "1980.00",
        "purchases": "121",
        "ad_support": "1",
        "wxapp_support": "2",
        "encrypt": "0",
        "createtime": "1533455964",
        "type": "1",
        "displayorder": "1",
        "price_range": "1620.00 - 1980.00",
        "is_new": true,
        "date_format": "2018-08-05",
        "month_day_format": "08.05",
        "time_format": "15:59:24",
        "username": "hudasd"
        }
    ];
    let getDB=()=>apps;
    """
    compile = js_engine.compile(jss)
    res = compile.call('getDB')
    print(res)
    exit()
    
    
    UnicodeEncodeError: 'ascii' codec can't encode characters in position 132-143: ordinal not in range(128)
    
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部