From 548af14fb2a961023a0316a9c0d2a96bef5fa37b Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Wed, 29 Sep 2021 18:04:44 -0700 Subject: [PATCH] Use latin-1 encoding for reading interface file content Fixes #610 Signed-off-by: Jacob Perron --- rosidl_adapter/rosidl_adapter/action/__init__.py | 2 +- rosidl_adapter/rosidl_adapter/msg/__init__.py | 2 +- rosidl_adapter/rosidl_adapter/srv/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rosidl_adapter/rosidl_adapter/action/__init__.py b/rosidl_adapter/rosidl_adapter/action/__init__.py index 6e8719b6c..cb7a74b83 100644 --- a/rosidl_adapter/rosidl_adapter/action/__init__.py +++ b/rosidl_adapter/rosidl_adapter/action/__init__.py @@ -24,7 +24,7 @@ def convert_action_to_idl(package_dir, package_name, input_file, output_dir): abs_input_file = package_dir / input_file print(f'Reading input file: {abs_input_file}') abs_input_file = package_dir / input_file - content = abs_input_file.read_text(encoding='utf-8') + content = abs_input_file.read_text(encoding='iso-8859-1') action = parse_action_string(package_name, input_file.stem, content) output_file = output_dir / input_file.with_suffix('.idl').name diff --git a/rosidl_adapter/rosidl_adapter/msg/__init__.py b/rosidl_adapter/rosidl_adapter/msg/__init__.py index b02b7b5bd..14d961957 100644 --- a/rosidl_adapter/rosidl_adapter/msg/__init__.py +++ b/rosidl_adapter/rosidl_adapter/msg/__init__.py @@ -24,7 +24,7 @@ def convert_msg_to_idl(package_dir, package_name, input_file, output_dir): abs_input_file = package_dir / input_file print(f'Reading input file: {abs_input_file}') abs_input_file = package_dir / input_file - content = abs_input_file.read_text(encoding='utf-8') + content = abs_input_file.read_text(encoding='iso-8859-1') msg = parse_message_string(package_name, input_file.stem, content) output_file = output_dir / input_file.with_suffix('.idl').name diff --git a/rosidl_adapter/rosidl_adapter/srv/__init__.py b/rosidl_adapter/rosidl_adapter/srv/__init__.py index c57b7013f..f3abe87f8 100644 --- a/rosidl_adapter/rosidl_adapter/srv/__init__.py +++ b/rosidl_adapter/rosidl_adapter/srv/__init__.py @@ -24,7 +24,7 @@ def convert_srv_to_idl(package_dir, package_name, input_file, output_dir): abs_input_file = package_dir / input_file print(f'Reading input file: {abs_input_file}') abs_input_file = package_dir / input_file - content = abs_input_file.read_text(encoding='utf-8') + content = abs_input_file.read_text(encoding='iso-8859-1') srv = parse_service_string(package_name, input_file.stem, content) output_file = output_dir / input_file.with_suffix('.idl').name