Consultor Eletrônico



Kbase P80671: Problems displaying extended characters in .NET Web Services Client.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   03/05/2005
Status: Verified

FACT(s) (Environment):

OpenEdge 10.0A
OpenEdge 10.0B
Web Services

SYMPTOM(s):

Problems displaying extended characters in .NET Web Services Client.

Extended characters are displayed as 2 Latin 1 characters instead of 1 UTF-8 character.

Extended characters are displayed as question mark.

CAUSE:

Bug# 20040514-022

CAUSE:

The Web Services Adapter (WSA) does not include the HTTP charset parameter within the HTTP response header. The .NET clients are unable to determine the correct character encoding for the SOAP messages when the HTTP charset parameter is missing.

FIX:

Upgrade to OpenEdge 10.0B Service Pack 2 or higher. The %DLC\servlets\wsa servlet needs to be redeployed into your JSE in order for the fix to take effect. It is recommended you export your existing Web Services before you do this. You will then be able to import your Web Services once you finish applying the fix.
- OR -
A possible workaround is to "re-convert" the string containing the extended characters to chars, back to bytes, and then rebuild it back to a string. The following piece of code shows such an example in C#.NET (assume CustName is the string containing extended characters):


String m_name = CustName;
char[] c_name = m_name.ToCharArray(0,m_name.Length);
byte[] b_name = new byte[c_name.Length];
for (int i = 0; i < b_name.Length;i++)
{
b_name[i] = (byte) c_name[i];
}
CustName = String(System.Text.Encoding.UTF8.GetChars(b_name));