2

I'am having an issue with encoding as I retrieve informations such as customers names or orders info through webservice API. I'am using C# to manipulate the API, here is an example of the encoding problem :

1) Here is the value as seen in the MYSQL database (input source) : TestAcctééa --> We can see that the accent characters "éé" are well interpreted.

2) Here is the value as seen when I retrieve the information through the api : TestAcct????a --> We can see there is a problem, it does this with all the special characters (é, ç, ê,...). I cannot display the string correctly in the console and as I insert it in the target database (MSSQL), it keeps the questions marks in place of the special characters.

Here is my example code to get this particular information with the api :

    filters filters = new filters();
    WebserviceApi service = new WebserviceApi();
    string login = service.login("******", "********");
    string test = null;
    List<customerCustomerEntity> customers = service.customerCustomerList(login, filters).ToList();

    foreach (var customer in customers)
    {
        if(customer.email == "test@gmail.com")
        {
            test = customer.firstname;
        }

    }


    MessageBox.Show(test);

I already tried different solutions from forums such as changing the encoding in C# or convert it but none has worked...

Btw, the encoding of the source database is UTF-8 Unicode (utf8).

Thank for your help.

Dams
  • 21
  • 1
  • Look for "question marks" [_here_](http://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored) – Rick James May 05 '17 at 19:57
  • I tried all the solutions in this post but none have worked. What I also tried is to retrieve the data directly through a MySqlConnection object in my code instead of using the webservice api and it works without problems... – Dams May 12 '17 at 07:02
  • Let's see the HEX, as discussed in that link. – Rick James May 12 '17 at 14:03

0 Answers0