Sawitree Cha
Sawitree Cha

Reputation: 199

How to set -charset language in wc3270 using Robot Framework

I try to robot mainframe with Mainframe3270 library but I don't know how to use character set in Robot, the wc3270 doesn't support Thai language. And I try to use wc3270 emulator by manual it has option to set language by option character set and select the language, but I don't know how to do this step in Robot

*** Settings ***
Library           Mainframe3270

*** Keyword ***
Update Credit Card
  Open Connection    ${HOSTNAME}
  Change Wait Time    0.9
  Page Should Contain String    PLEASE LOGON FOLLOW MENU TO SCB MAINFRAME   S/390
  Write Bare    ${LOGINCMD}    #login B2K
  Send Enter
  ${getStatus}    Read    12    18    3

I would like to get Thai text but I got the ??????? text instead because the wc3270 cannot display Thai. Please anyone help me.

Upvotes: 0

Views: 1038

Answers (1)

Timothy Sipples
Timothy Sipples

Reputation: 109

Per this documentation page for wc3270:

http://x3270.bgp.nu/wc3270-man.html#Character-Sets

Thai language support is available at least in certain builds of wc3270. Try wc3270 -v to see if your build supports it. If it does, you can use the -charset thai option (or -charset cp1160, or equivalents in wc3270.charset).

If you're using this framework:

https://github.com/Altran-PT-GDC/Robot-Framework-Mainframe-3270-Library

then you could simply hack the Python source code to add that codepage parameter. If I'm reading the current source code correctly (not sure), then you could change one line in p3270.py. Look for this line:

args = ['-xrm', 'wc3270.unlockDelay: False', '-xrm', 'wc3270.model: 2']

and change it to (all one line):

args = ['-xrm', 'wc3270.unlockDelay: False', '-xrm', 'wc3270.model: 2' '-xrm', 'wc3270.charset: thai']

and that should work. That's not probably not the best, most elegant solution -- perhaps you can do better.

According to the wc3270 documentation you'll also need to make sure Microsoft Windows (where wc3270 runs) is set to Thai language.

Upvotes: 1

Related Questions