pmattes / x3270

Family of IBM 3270 emulators
46 stars 18 forks source link

x3270: changing the codepage from menu resets the font size #54

Closed swhobbit closed 1 year ago

swhobbit commented 1 year ago

changing the codepage from menu resets the font size

to reproduce, set large font size reset codepage

the font size resets.

pmattes commented 1 year ago

What code page did you change from, and what code page did you change to? Xt does not do font substitution, so x3270 must use a font that has the right character set. E.g., if you switch from a U.S. code page to a Greek one, x3270 can no longer use the 3270 fonts (though it will use 3270gr if it is available).

swhobbit commented 1 year ago

Switch from default (BRACKET) to CP 1047

pmattes commented 1 year ago

Yup, that's a bug. I will get on it shortly.

pmattes commented 1 year ago

Fixed in 4.2ga7.

Bamboolyj commented 9 months ago

I have a relevant question. I have change the codepage to cp937, but the Chinese character still is a nonsense.

pmattes commented 9 months ago

@Bamboolyj, could you provide me with a bit more information?

Bamboolyj commented 9 months ago

Hi @pmattes, thanks for your help. 1: I used the latest version of wc3270-noinstall-64 (http://prdownloads.sourceforge.net/x3270/wc3270-4.3ga3-noinstall-64.zip?download) 2: My python called wc3270.exe to run the code. 3: I have checked the relevant file, it told me I need to change the codepage to cp937. But when i have set the codepage to cp937, it still cannot display Chinese. it seems i need to change the windows codepage(now it is cp1252) to utf-8, but it is blocking me from doing this operation. image image image

image

I am looking forward to your reply, it has been blocking me for a long time, many thanks!!!

pmattes commented 9 months ago

The local encoding affects only how text files such as keymaps are interpreted when read into wc3270, how text such as trace files is output, and it is the default for text file transfers. It does not affect how text is displayed on the emulated 3270 display screen -- wc3270 switches to UTF-8 internally for that.

The display issue you are probably seeing is a frustrating one. wc3270 uses a Windows Console (the old-fashioned kind, not the new Windows Terminal), and Windows Consoles steadfastly refuse to display Chinese text unless the computer is configured to use Chinese as its display language. I think it worked without that in Windows XP, but not since then.

I'm pretty sure that Windows Terminal does not have this limitation, but I haven't figured out how to cleanly integrate wc3270 with Windows Terminal yet.

Have you tried wx3270?

Bamboolyj commented 9 months ago

Thanks for your answer, but my code is based on wc3270 to run. maybe I need to find another way to deal with this problem. thank you

pmattes commented 9 months ago

Interesting -- I just checked, and with the right font on Windows 11, wc3270 will display Chinese characters properly. For my test, I used the SimHei font.

Bamboolyj commented 9 months ago

wow, how an exciting news!!! could you share more details to me, i want to follow your operate steps to set the args, if there are screenshots even better. it is very important to me. thank you very much.

pmattes commented 9 months ago

I'm running Windows 11 22H2. I haven't tried other versions. I have Chinese language support installed (fonts, input methods).

I used the wc3270 4.3 Session Wizard to create a session: image

Once the wc3270 window was open, I had to change the Font explicitly to SimHei. Despite my explicit configuration in the Session Wizard, the window used Lucida Console, which works, but not very well. image

That's pretty much it.