PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: gshauffenburg on July 26, 2024, 03:28:27 PM

Title: Currency Code Display
Post by: gshauffenburg on July 26, 2024, 03:28:27 PM
I am trying to display various currency codes in PVX.  The HTML characters for the code are being stored in a variable.

The following works for several, but not all codes:
- ? EVS("$"+HTA(CVS(htmlcode$,"HTML:ASCII"))+"$")

For instance setting HTMLCODE$="¥" (Yen) will work, but setting HTMLCODE$="₯" (Drachma) will not work.

I am looking for any suggestions on how to improve my logic, or to obtain an understanding as to why not all HTML codes can be converted.  We require the HTML code for display on the WEB, but my understanding, and experience is that I cannot display HTML in PVX or Nomads.

Thank you in advance for taking time to review this thread.
Title: Re: Currency Code Display
Post by: Devon Austen on July 30, 2024, 08:29:00 AM
Your logic converts the HTML code to ASCII encoding.

The Yen symbol is part of the ASCII encoding. This means there is a conversion for us to do.

The Drachma symbol is not part of the ASCII encoding. This means there is no valid conversion to ASCII and the ? symbol is used.

If you want to use symbols like Drachma you need to use UTF-8. If you do not have UTF-8 mode enabled you will need to first enable it via SET_PARAM 'U8' then you can convert to UTF8 instead of ASCII.

CVS(htmlcode$,"HTML:UTF8")

Alternatively if you just want to display HTML you could always use a embedded browser in your panel to load a HTML file. You can add a COM control to a panel and then select Chromium Browser for the COM control.
Title: Re: Currency Code Display
Post by: gshauffenburg on July 30, 2024, 11:45:16 AM
Devon,

Thank you for the information.

I will try your suggestions and if I require anything further I will add an update here.