diff options
| author | [email protected] <[email protected]> | 2011-10-30 00:44:18 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2011-10-30 00:44:18 +0000 |
| commit | 6aa93f460a8b1fc830449d90e46430eb0fffe803 (patch) | |
| tree | a0d0897347eb4dbe6bb494d5839b8c99ec00c5ea /tools/building.py | |
| parent | 7b6f018f73181daa4c3718a0203be8f6530ef605 (diff) | |
fixed file name with Chinese encoding issue, which is merged from [email protected].
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1779 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'tools/building.py')
| -rw-r--r-- | tools/building.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/building.py b/tools/building.py index 56675060b6..5cf225428c 100644 --- a/tools/building.py +++ b/tools/building.py @@ -11,6 +11,7 @@ BuildOptions = {} Projects = []
Rtt_Root = ''
Env = None
+fs_encoding = sys.getfilesystemencoding()
def _get_filetype(fn):
if fn.rfind('.c') != -1 or fn.rfind('.C') != -1 or fn.rfind('.cpp') != -1:
@@ -122,7 +123,7 @@ def IARAddGroup(parent, name, files, project_path): file = SubElement(group, 'file')
file_name = SubElement(file, 'name')
- file_name.text = '$PROJ_DIR$\\' + path
+ file_name.text = ('$PROJ_DIR$\\' + path).decode(fs_encoding)
iar_workspace = '''<?xml version="1.0" encoding="iso-8859-1"?>
@@ -221,12 +222,12 @@ def MDK4AddGroup(ProjectFiles, parent, name, files, project_path): if ProjectFiles.count(name):
name = basename + '_' + name
ProjectFiles.append(name)
- file_name.text = name
+ file_name.text = name.decode(fs_encoding)
file_type = SubElement(file, 'FileType')
file_type.text = '%d' % _get_filetype(name)
file_path = SubElement(file, 'FilePath')
- file_path.text = path
+ file_path.text = path.decode(fs_encoding)
def MDK4Project(target, script):
project_path = os.path.dirname(os.path.abspath(target))
|
