####

setLocale失败
  • 查看当前字符集
      locale
  • 查看当前系统支持的字符集
      locale -a
  • 安装中文字符集
      sudo apt install language-pack-zh-hans
  • 设置/etc/locale.gen
    进入这个文件,一滑到底,将zh_CN.UTF-8 UTF-8一行解开注释
  • 切换系统字符集为zh_CN.utf8
    编辑/etc/profile,在最后新增两行代码:
      export LANG=zh_CN.UTF-8
      export LANGUAGE=zh_CN:zh
  • 重启Ubuntu
  • locale -a 中缺少zh_CN.utf8 zh_CN.gbk

  • 添加GBK编码

      sudo vim /var/lib/locales/supported.d/local
    
      en_US.UTF-8 UTF-8
      zh_CN.UTF-8 UTF-8
      zh_CN.GBK GBK
      zh_CN.GB2312 GB2312
      zh_CN.GB18030 GB18030
  • 更新编码

      sudo locale-gen
      sudo dpkg-reconfigure --force locales
编译依赖库
  • jsoncpp
      sudo apt-get install libjsoncpp-dev
  • rabbitmq-c
      sudo apt-get install librabbitmq-dev
  • curl
      sudo apt-get install libcurl4-openssl-dev
  • sql
      sudo apt-get install unixodbc-dev
  • zlib
      sudo apt-get install zlib1g zlib1g-dev
  • 统信UOS

    防火墙
    sudo ufw allow 80/tcp
文档更新时间: 2025-10-21 16:46   作者:方杰