Search Unity

iOS Error loading scenes when device has Turkish language

Discussion in 'iOS and tvOS' started by ThisGuise, Jun 21, 2019.

  1. ThisGuise

    ThisGuise

    Joined:
    Oct 20, 2015
    Posts:
    9
    We are experiencing an issue where some scene won't load when the device is set to Turkish language. The same build works fine when the device is set to other languages.

    When checking the error in the log it prints the error when a scene has not been added to the buildsettings. The scene name printed is with all lowercase while the actual scene names have capital letters. There are other scenes with capital lettered names that work though.

    This started happening after migrating from 2017.4 to 2018.4.

    Has anyone experienced somethings similar before?
     
  2. ThisGuise

    ThisGuise

    Joined:
    Oct 20, 2015
    Posts:
    9
    The issue has been found and fixed.

    After the update from 2017 to 2018 and the accompanying upgrade from .Net 3 to 4.5 we hadn't accounted for Cultures properly. We were using some string conversions around loading scenes. This now uses the device language to set the CultureInfo which is used in string formatting. In this case it turned all 'i's were formatted into their dot-less version which made cases where strings were used as references for what to load fail.

    Our solution was to set a default culture at the start of the game.
    Code (CSharp):
    1. CultureInfo culture = new System.Globalization.CultureInfo("en-US");
    2. CultureInfo.DefaultThreadCurrentCulture = culture;
    3. CultureInfo.DefaultThreadCurrentUICulture = culture;
     
    p0w1nd and Tanek like this.
  3. p0w1nd

    p0w1nd

    Joined:
    Oct 28, 2015
    Posts:
    140
    This solution is good. Thanks!!