This is a migrated thread and some comments may be shown as answers.

Encoding Problem

1 Answer 53 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
ITA
Top achievements
Rank 1
ITA asked on 31 May 2014, 08:15 AM
Hi,

we have an encoding problem in a autocompletenbox. As you can see on the attached file all "ä", "ü", "ö", "ß", are something like
a "?". We bind a txt-file to the autocompletebox.
using (StreamReader reader = new StreamReader(file, System.Text.Encoding.UTF8))
{
    string line;
    Int32 i = 0;
    while ((line = reader.ReadLine()) != null)
    {
        i++;
        string[] tmp = line.Split(';');
        vartab.Add(new Vartab(tmp[1], tmp[0], i));
    }
}

How can we solve this problem?

Thanks a lot
Best Regrads from Austria
Rene

1 Answer, 1 is accepted

Sort by
0
Accepted
Rosen Vladimirov
Telerik team
answered on 03 Jun 2014, 09:36 PM
Hello Rene,

Thank you for contacting us. I've tested the mentioned scenario and everything works fine on my side when the text file is encoded with UTF8. If the file is using some other encoding, the UTF8 that's used in the StreamReader's constructor will not be able to read all symbols correctly. Could you check if your file is using UTF8 encoding?

I'm sending you my test project and the test file - as you can see the symbols are shown correctly when you search inside RadAutoCompleteBox's items.

I'm looking forward to hearing from you.

Regards,
Rosen Vladimirov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
AutoCompleteBox
Asked by
ITA
Top achievements
Rank 1
Answers by
Rosen Vladimirov
Telerik team
Share this question
or