Skip to content

Commit

Permalink
use latin-1 encoding for .idl files
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk Thomas <[email protected]>
  • Loading branch information
dirk-thomas committed Jul 26, 2019
1 parent 18f022b commit aae1e9a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rosidl_adapter/rosidl_adapter/action/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ def convert_action_to_idl(package_dir, package_name, input_file, output_dir):
'action': action,
}

expand_template('action.idl.em', data, output_file)
expand_template('action.idl.em', data, output_file, encoding='iso-8859-1')
return output_file
2 changes: 1 addition & 1 deletion rosidl_adapter/rosidl_adapter/msg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def convert_msg_to_idl(package_dir, package_name, input_file, output_dir):
'msg': msg,
}

expand_template('msg.idl.em', data, output_file)
expand_template('msg.idl.em', data, output_file, encoding='iso-8859-1')
return output_file


Expand Down
6 changes: 3 additions & 3 deletions rosidl_adapter/rosidl_adapter/resource/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
import em


def expand_template(template_name, data, output_file):
def expand_template(template_name, data, output_file, encoding='utf-8'):
content = evaluate_template(template_name, data)

if output_file.exists():
existing_content = output_file.read_text(encoding='utf-8')
existing_content = output_file.read_text(encoding=encoding)
if existing_content == content:
return
elif output_file.parent:
os.makedirs(str(output_file.parent), exist_ok=True)

output_file.write_text(content, encoding='utf-8')
output_file.write_text(content, encoding=encoding)


_interpreter = None
Expand Down
2 changes: 1 addition & 1 deletion rosidl_adapter/rosidl_adapter/srv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ def convert_srv_to_idl(package_dir, package_name, input_file, output_dir):
'srv': srv,
}

expand_template('srv.idl.em', data, output_file)
expand_template('srv.idl.em', data, output_file, encoding='iso-8859-1')
return output_file

0 comments on commit aae1e9a

Please sign in to comment.