MarketSquare / Robot-Framework-Mainframe-3270-Library

Test library for Robot Framework to allow interaction with IBM Mainframe 3270.
MIT License
38 stars 18 forks source link

Unicode read / write support #133

Open doppio-wacharin opened 3 months ago

doppio-wacharin commented 3 months ago

This PR was created based on the discussion on the following issues => https://github.com/MarketSquare/Robot-Framework-Mainframe-3270-Library/issues/70

Initially, I

samuelpcabral commented 3 months ago

Hi @doppio-wacharin I pull your branch and run the tests in PUB400.. the ones in "atest/mainframe.robot" but got a lot of failures, like that: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa7 in position 41: invalid start byte

log.zip

The problem is in py327.py line 473.. return cmd.data[0].decode("utf-8") if return to: "unicode_escape" all the tests passes.. but I can´t be sure if the Thai chars works, because pub400 don´t have support for them... I try to use

Write Unicode Bare กขค

but the screen in pub400 show me like that: mainframe_test

doppio-wacharin commented 3 months ago

Hi @doppio-wacharin I pull your branch and run the tests in PUB400.. the ones in "atest/mainframe.robot" but got a lot of failures, like that: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa7 in position 41: invalid start byte

log.zip

The problem is in py327.py line 473.. return cmd.data[0].decode("utf-8") if return to: "unicode_escape" all the tests passes.. but I can´t be sure if the Thai chars works, because pub400 don´t have support for them... I try to use

Write Unicode Bare กขค

but the screen in pub400 show me like that: mainframe_test

I don't have pub400 but let me try to test it in the hercules, thx

samuelpcabral commented 3 months ago

You can test in PUB400 without create a user... here is the configurations: https://github.com/MarketSquare/Robot-Framework-Mainframe-3270-Library/wiki/Keyword-Tests

doppio-wacharin commented 3 months ago

I have created a simple script for this. and this seams working. Screenshot 2024-07-03 at 6 58 12 PM

Screenshot 2024-07-03 at 6 59 00 PM

But now the atest seams broken. I'm checking whether it is because of my change or something else.

doppio-wacharin commented 3 months ago

The failure in the atest is my mistake T_T ( I tried to run all of this on macbook ) All pass on the ubuntu docker

Screenshot 2024-07-04 at 4 15 42 PM

I think all are good now. Do you have anything else to be adjusted? or any concerns? @samuelpcabral

samuelpcabral commented 3 months ago

@doppio-wacharin as soon I have some free time I take a look.. thanks

samuelpcabral commented 2 months ago

Sorry for the late @doppio-wacharin I just have time to see now.. I checkout your branch again.. but still having issues in reading with utf-8

Traceback (most recent call last): File "C:\Merkle\repositories\Mainframe-3270-Library\Mainframe3270\__init__.py", line 197, in run_keyword return DynamicCore.run_keyword(self, name, args, kwargs) File "C:\Python39\lib\site-packages\robotlibcore.py", line 173, in run_keyword return self.keywords[name](*args, **(kwargs or {})) File "C:\Merkle\repositories\Mainframe-3270-Library\Mainframe3270\keywords\assertions.py", line 33, in page_should_contain_string result = self.mf.search_string(txt, ignore_case) File "C:\Merkle\repositories\Mainframe-3270-Library\Mainframe3270\py3270.py", line 480, in search_string line = self.string_get(ypos + 1, 1, self.model_dimensions["columns"]) File "C:\Merkle\repositories\Mainframe-3270-Library\Mainframe3270\py3270.py", line 473, in string_get return cmd.data[0].decode("utf-8") UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa7 in position 41: invalid start byte

See my log.html from mainframe.robot execution... log.zip

If you want to chat and try to see what could be happening.. you can send me a DM in robot framework slack: https://robotframework.slack.com