Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing UnicodeEncodeError while doing ARXML to DBC conversion #826

Open
Ram2763 opened this issue Dec 27, 2024 · 1 comment
Open

Facing UnicodeEncodeError while doing ARXML to DBC conversion #826

Ram2763 opened this issue Dec 27, 2024 · 1 comment

Comments

@Ram2763
Copy link

Ram2763 commented Dec 27, 2024

Facing below error while workign on arxml to .dbc converion,
usig this command : python -m canmatrix.cli.convert -vv CHG00.arxml CHG00.dbc

Command window tarce:
WARNING - dbc - Signal EHV1E09_var10_oCANFD_BT_Bus::HCHGILM_dms65_oEHV1E09_var10_oCANFD_BT_Bus name exceeds 32 characters, consider updating the signal name within the character limit(Max 32 characters)
WARNING - dbc - Signal EHV1E09_var10_oCANFD_BT_Bus::ECAN_HTD_dms00_oEHV1E09_var10_oCANFD_BT_Bus name exceeds 32 characters, consider updating the signal name within the character limit(Max 32 characters)
WARNING - dbc - Signal EHV1E09_var10_oCANFD_BT_Bus::OVL_HTD_dms00_oEHV1E09_var10_oCANFD_BT_Bus name exceeds 32 characters, consider updating the signal name within the character limit(Max 32 characters)
WARNING - dbc - Signal EHV1E09_var10_oCANFD_BT_Bus::SMRW_HTD_dms00_oEHV1E09_var10_oCANFD_BT_Bus name exceeds 32 characters, consider updating the signal name within the character limit(Max 32 characters)
WARNING - dbc - Signal EHV1E09_var10_oCANFD_BT_Bus::EVL_HTD_dms00_oEHV1E09_var10_oCANFD_BT_Bus name exceeds 32 characters, consider updating the signal name within the character limit(Max 32 characters)
WARNING - dbc - Signal EHV1E09_var10_oCANFD_BT_Bus::EPCHG_dms00_oEHV1E09_var10_oCANFD_BT_Bus name exceeds 32 characters, consider updating the signal name within the character limit(Max 32 characters)
WARNING - dbc - Signal EHV1E09_var10_oCANFD_BT_Bus::HM_HTD_dms65_oEHV1E09_var10_oCANFD_BT_Bus name exceeds 32 characters, consider updating the signal name within the character limit(Max 32 characters)
WARNING - dbc - Signal EHV1E09_var10_oCANFD_BT_Bus::HEL_HTD_dms65_oEHV1E09_var10_oCANFD_BT_Bus name exceeds 32 characters, consider updating the signal name within the character limit(Max 32 characters)
WARNING - dbc - Signal EHV1E09_var10_oCANFD_BT_Bus::HEH_HTD_dms65_oEHV1E09_var10_oCANFD_BT_Bus name exceeds 32 characters, consider updating the signal name within the character limit(Max 32 characters)
WARNING - dbc - Signal EHV1E09_var10_oCANFD_BT_Bus::EDCDC_dms00_oEHV1E09_var10_oCANFD_BT_Bus name exceeds 32 characters, consider updating the signal name within the character limit(Max 32 characters)
WARNING - dbc - Signal EHV1E09_var10_oCANFD_BT_Bus::VB_HTD_dms00_oEHV1E09_var10_oCANFD_BT_Bus name exceeds 32 characters, consider updating the signal name within the character limit(Max 32 characters)
WARNING - dbc - Signal EHV1E09_var10_oCANFD_BT_Bus::HWT_HTD_dms00_oEHV1E09_var10_oCANFD_BT_Bus name exceeds 32 characters, consider updating the signal name within the character limit(Max 32 characters)
WARNING - dbc - Signal EHV1E09_var10_oCANFD_BT_Bus::CHGCCTST_dms00_oEHV1E09_var10_oCANFD_BT_Bus name exceeds 32 characters, consider updating the signal name within the character limit(Max 32 characters)
Traceback (most recent call last):
File "C:\Program Files\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Program Files\Python39\lib\site-packages\canmatrix\cli\convert.py", line 160, in
sys.exit(cli_convert())
File "C:\Program Files\Python39\lib\site-packages\click\core.py", line 1157, in call
return self.main(*args, **kwargs)
File "C:\Program Files\Python39\lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
File "C:\Program Files\Python39\lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Program Files\Python39\lib\site-packages\click\core.py", line 783, in invoke
return callback(*args, **kwargs)
File "C:\Program Files\Python39\lib\site-packages\canmatrix\cli\convert.py", line 155, in cli_convert
canmatrix.convert.convert(infile, outfile, **options)
File "C:\Program Files\Python39\lib\site-packages\canmatrix\convert.py", line 351, in convert
canmatrix.formats.dumpp(out_dbs, out_file_name, **options)
File "C:\Program Files\Python39\lib\site-packages\canmatrix\formats_init.py", line 129, in dumpp
dump(db, file_object, export_type, **options)
File "C:\Program Files\Python39\lib\site-packages\canmatrix\formats_init.py", line 104, in dump
module_instance.dump(can_matrix_or_cluster, file_object, **options) # type: ignore
File "C:\Program Files\Python39\lib\site-packages\canmatrix\formats\dbc.py", line 327, in dump
f.write(signal_line.encode(dbc_export_encoding, ignore_encoding_errors))
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2103' in position 67: ordinal not in range(256)

@ebroecker
Copy link
Owner

Hi @Ram2763

you could try to us another export-encoding for the dbc:
https://canmatrix.readthedocs.io/en/latest/cli.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants