RK Ubuntu16.04 LC_ALL=C 、Python ascii 编码

 

一.LC_ALL=C

1.1.编译报的日志  flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.

1
2
3
4
5
6
7
8
9
10
11
12
2% 56/2683] target Java: ext (out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes)
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2% 59/2683] Lex: aidl <= system/tools/aidl/aidl_language_l.ll
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/host/linux-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_l.cpp system/tools/aidl/aidl_language_l.ll"
flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

1.2.解决方法 build\envsetup.sh

添加  

1
export LC_ALL=C

LC_ALL=C 是为了去除所有本地化的设置,让命令能正确执行  

二.UnicodeEncodeError: 'ascii'

2.1.Python编译  默认的编码是ascii  将python的默认编码置为utf8的编码格式

1
2
3
4
5
6
7
8
9
10
11
12
FAILED: /bin/bash -c "(rm -f out/target/product/rk3288/installed-files.txt ) && (build/tools/fileslist.py out/target/product/rk3288/system > out/target/product/rk3288/installed-files.json ) && (build/tools/fileslist_util.py -c out/target/product/rk3288/installed-files.json > out/target/product/rk3288/installed-files.txt )"
Traceback (most recent call last):
  File "build/tools/fileslist_util.py", line 68, in <module>
    main(sys.argv)
  File "build/tools/fileslist_util.py", line 62, in main
    PrintCanonicalList(args[0])
  File "build/tools/fileslist_util.py", line 30, in PrintCanonicalList
    print "{0:12d}  {1}".format(line["Size"], line["Name"])
UnicodeEncodeError: 'ascii' codec can't encode characters in position 26-31: ordinal not in range(128)
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

2.2.解决方法

      build/tools/fileslist_util.py  开头加上

1
2
3
4
5
6
7
8
# limitations under the License.
 #
  
+import sys 
+reload(sys) 
+sys.setdefaultencoding('utf8')  
+      
 import getopt, json, sys

  

  

 

    

  

posted @   CrushGirl  阅读(482)  评论(0编辑  收藏  举报
(评论功能已被禁用)
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】
点击右上角即可分享
微信分享提示