From fdd70535af5bc5d81e4e160e3c878516f4885db7 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 d4b128079..5186066cd 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 1cd056ada..f78496cfc 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 41ae4e053..bd74584db 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