WebGadget problems with german umlauts

Just starting out? Need help? Post your questions and find answers here.
flashbob
User
User
Posts: 92
Joined: Sat May 11, 2024 4:04 pm

WebGadget problems with german umlauts

Post 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 ?
.
infratec
Always Here
Always Here
Posts: 7662
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: WebGadget problems with german umlauts

Post 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.
flashbob
User
User
Posts: 92
Joined: Sat May 11, 2024 4:04 pm

Re: WebGadget problems with german umlauts

Post 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...
infratec
Always Here
Always Here
Posts: 7662
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: WebGadget problems with german umlauts

Post 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()
Post Reply