Page 1 of 1

WebGadget problems with german umlauts

Posted: Sat Jun 15, 2024 7:51 pm
by flashbob
I want to display html code in the web gadget (received by libcurl) and have problems displaying the german umlauts only under Windows 7: In MacOS the code is running fine. Here the results:

Code: Select all

Output in MemoryViewer:
  20 00 28 00 C4 00 2C 00 DC 00 2C 00 D6 00 2C 00   .(.Ä.,.Ü.,.Ö.,.
  E4 00 2C 00 FC 00 2C 00 F6 00 2C 00 DF 00 29 00  ä.,.ü.,.ö.,.ß.).
  3C 00 62 00 72 00 3E 00 3C 00 62 00 72 00 3E 00  <.b.r.>.<.b.r.>.
  
Output string in debugger
  (Ä,Ü,Ö,ä,ü,ö,ß)

Output in WebGadget  
  (�,�,�,ä,ü,ö,�)
  
Display source code of WebGadget (right mouse click in web gadget -> show source code)   
  (Ä,Ü,Ö,ä,ü,ö,ß)
  
Display source code using WinAPI
  (�,�,�,ä,ü,ö,�)
Any ideas how to fix it ?
.

Re: WebGadget problems with german umlauts

Posted: Sat Jun 15, 2024 9:18 pm
by infratec
How do you show the text in the webgadget?

Please show us the complete string you send to the webgadget.

And a running code which shows the behaviour is the best, because then 10 peoples who want to help don't need to write some code.

Re: WebGadget problems with german umlauts

Posted: Sat Jun 15, 2024 9:28 pm
by flashbob
I use this way to show the html code in Windows and Mac:

Code: Select all

SetGadgetItemText(#web_gadget, #PB_Web_HtmlCode, msg_html)
Ok, I try to get html-code of libcurl...
Thanks in advance...

Re: WebGadget problems with german umlauts

Posted: Sun Jun 16, 2024 10:38 am
by infratec
You need a complete html page with charset setting

Like this:

Code: Select all

<!doctype html>
<html lang="de">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Test</title>
  </head>
  <body>
    Test: äöüßÄÖÜ
  </body>
</html>
Save this as a unicode file and open it with a web browser.

Or ... you can convert the unicode text to UTF-8 before you use SetGadgetItemText()