Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Problems with Russian strings encoding (C#)

Discussion in 'Editor & General Support' started by Marzoa, Jan 12, 2015.

  1. Marzoa

    Marzoa

    Joined:
    Dec 2, 2012
    Posts:
    50
    I am trying to create an array of strings that will contain Russian characters, this way:

    string[] rawKeys = new string[] {
    "!",
    "А",
    "Б",
    "В",
    "Г",
    "Д",
    "Е",
    "Ё",
    "Ж",
    "З",
    "И",
    "Й",
    "К",
    "Л",
    "М",
    "Н",
    "О",
    "П",
    "Р",
    "С",
    "Т",
    "У",
    "Ф",
    "Х",
    "Ц",
    "Ч",
    "Ш",
    "Щ",
    "Ъ",
    "Ы",
    "Ь",
    "Э",
    "Ю",
    "Я"
    };

    But after executing such code, the only string that keeps its value is the first one "!", the rest that are cyrillic characters are substituted by "??" instead.

    Any ideas?
     
  2. Marzoa

    Marzoa

    Joined:
    Dec 2, 2012
    Posts:
    50
    Now, this is really weird.

    If I add this code:

    char achar = 'З';

    And despite the solution Builds without errors at all within MonoDevelop, when I move to the Unity Editor the following error appear there: "Too many characters in character literal" and it says I must solve all compilation errors before executing the code.
     
  3. Marzoa

    Marzoa

    Joined:
    Dec 2, 2012
    Posts:
    50
  4. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    What's the bug case number you reported?
     
  5. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Since Marzoa is "not going to submit a bug report", I did that. The case number is 663040.

     
  6. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    As per my Answers answer, just set up MD to save files that MD has created in UTF-16.