RexxLA / NetRexx

Other
6 stars 0 forks source link

Windows codepage issue with UnicodeDémo.nrx #36

Closed rvjansen closed 3 months ago

rvjansen commented 1 year ago

On 17 Sep 2022, at 18:31, Marc remesm@gmail.com wrote:

Hi Terry,

both programs compiled fine on my Fedora 36 system, and a windows 11 evaluation copy, openjdk 18. On fedora it ran flawlessly first time. On windows output flaky until I set codepage to 65001 (UTF-8) : 'chcp 65001'.

More info on https://stackoverflow.com/questions/57131654/using-utf-8-encoding-chcp-65001-in-command-prompt-windows-powershell-window

Marc

On 9/17/22 01:56, Terry Fuller wrote: Hello all, Still playing around with 4.04 and having problems with the unicode examples. NetRexx portable processor 4.04-GA build 80-20220912-1843 Copyright (c) RexxLA, 2011,2022. All rights reserved. Parts Copyright (c) IBM Corporation, 1995,2008. Program UnicodeDemo.nrx 7 +++ expos??() +++ ^ +++ Error: Unexpected character found in source: '?' (hexadecimal encoding: 00A9) Compilation of 'UnicodeDemo.nrx' failed [one error] D:\NetRexx\4.04\examples\unicode>nrc UnicodeDémo.nrx java -cp ".;C:\Program Files (x86)\BSF4ooRexx\bsf4ooRexx-v450-20141014-bin.jar;D:\NetRexx\4.04\runlib\NetRexxR.jar;D:\NetRexx\4.04\lib\NetRexxC.jar;D:\NetRexx\4.04\lib\NetRexxF.jar;D:\NetRexx\404\lib\jansi-1.17.jar;D:\NetRexx\4.04\lib\jline-3.13.1-SNAPSHOT.jar;D:\NetRexx\4.04\tools\ant-task\ant-netrexx.jar;D:\NetRexx\40.4\tools\java2nrx\java2nrx.jar;D:\NetRexx\4.04\lib\ecj-I20201218-1800-NRX.jar;C:\Program Files\BSF4ooRexx\bsf4ooRexx-v641-20210207-bin.jar;C:\Program Files\BSF4ooRexx\jni4net.j-0.8.8.0.jar;C:\Program Files\BSF4ooRexx\oorexx.net.jar;D:\LibreOffice\program\classes\libreoffice.jar;D:\LibreOffice\program\;;;." -Dnrx.compiler=ecj org.netrexx.process.NetRexxC UnicodeDémo.nrx NetRexx portable processor 4.04-GA build 80-20220912-1843 Copyright (c) RexxLA, 2011,2022. All rights reserved. Parts Copyright (c) IBM Corporation, 1995,2008. Program UnicodeDémo.nrx 4 +++ class UnicodeD??mo +++ ^ +++ Error: Unexpected character found in source: '?' (hexadecimal encoding: 00A9) Compilation of 'UnicodeDΘmo.nrx' failed [one error] This is most probably a Windows (Windows 10 64-bit) setup issue, but I have no idea what to do... I've looked at the 'fonts' setting, and the samples show many characters outside the usual Latin alphabet (kanji &c), so I think something is there. Any help? -- taf

jlturriff commented 1 year ago

As requested via email, here is the code I scraped from the OP's email:

import java.awt.GraphicsEnvironment   class GetOSFontFamilyNames   method GetFontFamilyNames   c = 0 clzGE=GraphicsEnvironment / load the Java class / / invoke the static method "getLocalGraphicsEnvironment" / localGE=clzGE.getLocalGraphicsEnvironment() / invoke the method "getAvailableFontFamilyNames" / allFontFamilies=localGE.getAvailableFontFamilyNames()

/ iterate over all elements of the received "allFontFamilies" Java array / do ff over allFontFamilies       c = c + 1       say c.right(3)":" ff      / display the font family name / end   say say "you have a total of" c "fonts installed on your system

rvjansen commented 1 year ago

This generally works, when removing the class and method statements of course - it needs a method main(args=String[]) static when used in non-scripting mode. The commenets are a bit awkward. I'll ask Tony for the exact file.

remesm commented 5 months ago

can be closed. Windows codepage issue