Hi Rick, special characters like umlauts are incorrectly displayed,
It looks ok in SQL Server Management Studio.
Do you have a tip?
Thanks, Rolf
What's the Context?
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
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 ---
select cast(lastname as binary) as lastname from table_name
has brought it for me. Thanks a lot! Rolf
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 ---
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
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.
+++ Rick ---