Web Connection
Character set setting
Gravatar is a globally recognized avatar based on your email address. Character set setting
  Rolf
  All
  Aug 14, 2021 @ 01:19am

Hi Rick, special characters like umlauts are incorrectly displayed,

It looks ok in SQL Server Management Studio.

Do you have a tip?

Thanks, Rolf

Gravatar is a globally recognized avatar based on your email address. re: Character set setting
  Rick Strahl
  Rolf
  Aug 14, 2021 @ 10:17am

What's the Context?

Gravatar is a globally recognized avatar based on your email address. re: Character set setting
  Rolf
  Rick Strahl
  Aug 15, 2021 @ 12:58am

The list is created with HtmlDataGrid:

FUNCTION TrayConc
   Server.oApp.oData.CreateCursor('TRAYCONC','tquery', "where isdeleted = 0")
   Response.WRITE(THIS.PageHeaderTemplate("invitec Stammdaten Sets"))

   Response.WRITE("<h3 ><i class='fa fa-list'></i> INVITEC Stammdaten Sets </h3>")
   Response.WRITE("<hr/>")
   IF USED("tquery")
     lcHtml = HtmlDataGrid("tquery")
     Response.WRITE(lcHtml)
   endif

   Response.WRITE(THIS.PageFooterTemplate())
 ENDFUNC
Gravatar is a globally recognized avatar based on your email address. re: Character set setting
  Rick Strahl
  Rolf
  Aug 15, 2021 @ 11:38am

You need to set the character set in the output and encode the output.

If this is a Web Connection response then the default:

*** Explicitly specify UTF-8 encoding
Response.Encoding = "UTF8"

in OnProcessInit()...

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Character set setting
  Rolf
  Rick Strahl
  Aug 16, 2021 @ 02:24am
select cast(lastname as binary) as lastname from table_name 

has brought it for me. Thanks a lot! Rolf

Gravatar is a globally recognized avatar based on your email address. re: Character set setting
  Rick Strahl
  Rolf
  Aug 16, 2021 @ 11:39am

That's not a good solution as it only addresses that particular field.

You need to make sure the output is generated properly for all text you embed from FoxPro.

The only exception to that rule and use binary or pre-encoded data is if you're dealing with text from different code pages that FoxPro can't display and will not pass through.

Use UTF-8 encoding and you should have no problems.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Character set setting
  Rolf
  Rick Strahl
  Aug 17, 2021 @ 12:20am

I used UTF encoding. But the special characters were still incorrect. Root cause is the imported data, which is not UTF-8 probably? The yellow text (Picture from SQL Management Studio) is displayed correctly in Web Connection AND VFP Frontend. But SQL Server 2019 supports UTF-8? Rolf

Gravatar is a globally recognized avatar based on your email address. re: Character set setting
  Rick Strahl
  Rolf
  Aug 17, 2021 @ 09:02am

Why would you serialize yourself if it's automatic?

Read the docs for the service - there are options for controlling the serialization including sending a raw response.

Using the wwRestProcess class

+++ Rick ---

© 1996-2021