2 Replies - 692 Views - Last Post: 09 July 2015 - 02:35 PM Rate Topic: -----

#1 iliali16  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 42
  • Joined: 19-December 09

When reading a file I get ? as input instead of Cyrillic letters

Posted 09 July 2015 - 02:30 PM

Thank you very much for all the help till now.

I have the following problem:
 static void Main(string[] args)

    {
        Dictionary<string, string> dict = new Dictionary<string, string>();

        using (StreamReader reader = new StreamReader(@"C:\test.csv"))
        {
            string line;
            while ((line = reader.ReadLine()) != null)
            {
                string[] parts = line.Split(',');
                dict.Add(parts[0],parts[1]);
            }
        }
        Console.WriteLine("enter name:");
            string name  = Console.ReadLine();
            if (dict.ContainsKey(name))
            {
                //
                string value = dict[name];
                Console.WriteLine(dict[name]);//value);
            }
            Console.ReadLine();

    }
}


And this is my Outout:
enter name:
ILIA
????



This is my CSV file content

ILIA,ИЛИЯ


Can you please help me out clear this ???? and get the correct symbols in Cyrillic?

Thank in advance for any help!

Ilia

Is This A Good Question/Topic? 0
  • +

Replies To: When reading a file I get ? as input instead of Cyrillic letters

#2 andrewsw  Icon User is online

  • say what now
  • member icon

Reputation: 6408
  • View blog
  • Posts: 25,887
  • Joined: 12-December 12

Re: When reading a file I get ? as input instead of Cyrillic letters

Posted 09 July 2015 - 02:32 PM

This isn't a discussion topic, it is a question about a problem you are having. Topic moved to C# forum.
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5922
  • View blog
  • Posts: 20,246
  • Joined: 05-May 12

Re: When reading a file I get ? as input instead of Cyrillic letters

Posted 09 July 2015 - 02:35 PM

You already have a topic about this open. Closing this thread.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1