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

Unicode read / write support #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

doppio-wacharin
Copy link

@doppio-wacharin doppio-wacharin commented Jun 20, 2024

This PR was created based on the discussion on the following issues => #70

Initially, I

  • created 2 more keywords which are Write Unicode and Write Bear Unicode
  • Modify the decoding when get text from the screen, from unicode_escape decoding to utf-8 decoding

@samuelpcabral samuelpcabral self-requested a review June 20, 2024 20:44
@samuelpcabral
Copy link
Member

samuelpcabral commented Jun 23, 2024

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
Copy link
Author

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
Copy link
Member

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
Copy link
Author

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
Copy link
Author

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
Copy link
Member

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

@samuelpcabral
Copy link
Member

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

Copy link
Member

@samuelpcabral samuelpcabral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mainframe.robot tests are not passing

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

Successfully merging this pull request may close these issues.

None yet

2 participants