Xbasic

convert_acp_to_utf8 Function

Syntax

C CONVERT_ACP_TO_UTF8(acptext as c)

Arguments

acptext

Character

Description

Convert ascii encoded text to utf8.

Example 

Convert data from UTF-8 to ansi code page.

dim cn as sql::connection
?cn.open("::Name::AADemo-Northwind")
= .T.

?cn.Execute("select * from customers where customerId = 'BERGS'")
= .T.

rs = cn.ResultSet
x = rs.data("CompanyName")
?x
= "Berglunds snabbköp"

?convert_utf8_to_acp(x)
= "Berglunds snabbköp"

y = convert_utf8_to_acp(x)
?y
= "Berglunds snabbköp"

?convert_acp_to_utf8(y)
= "Berglunds snabbköp"

See Also