[openrtm-commit:02907] r3064 - trunk/OpenRTM-aist
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 11月 7日 (火) 18:33:19 JST
Author: miyamoto
Date: 2017-11-07 18:33:19 +0900 (Tue, 07 Nov 2017)
New Revision: 3064
Modified:
trunk/OpenRTM-aist/convert_character_code.py
Log:
[compat, VxWorks] fixed bug.
Modified: trunk/OpenRTM-aist/convert_character_code.py
===================================================================
--- trunk/OpenRTM-aist/convert_character_code.py 2017-11-07 07:37:46 UTC (rev 3063)
+++ trunk/OpenRTM-aist/convert_character_code.py 2017-11-07 09:33:19 UTC (rev 3064)
@@ -34,8 +34,12 @@
for n in filelist:
with open(n, mode='rb') as f:
encoding = chardet.detect(f.read())["encoding"]
+ if encoding is None:
+ encoding = "utf_8_sig"
+ elif encoding.lower() == "utf-8":
+ encoding = "utf_8_sig"
str_list = []
- if encoding != code:
+ if encoding.lower() != code.lower():
try:
with codecs.open(n, "r", encoding) as f:
for row in f:
@@ -52,4 +56,4 @@
-
\ No newline at end of file
+
More information about the openrtm-commit
mailing list