Search Unity

Mono Upgrade Editor is using Window's locale settings

Discussion in 'Experimental Scripting Previews' started by Edy, Nov 25, 2016.

  1. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    426
    @bobdonovan are you still following this? It's very confusing to get official reply from you and then still seeing the broken behaviour.
     
    Qbit86 likes this.
  2. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    818
    That's weird cause this is not happening in any 2018.2 version, only in 2018.3.
     
  3. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,423
    upload_2019-3-13_20-43-58.png
     
    Levus3d and Qbit86 like this.
  4. Levus3d

    Levus3d

    Joined:
    Jun 14, 2018
    Posts:
    1
    Still I have commas in 2018.3.8f1.

    I'm working with uscript and visual studio and need to fix those commas manually after detecting syntax error in script.
    I'm not a programmer, I really don't know how to fix it permanently myself, need to fix by hand every float I'm using:/
     
  5. Vencarii

    Vencarii

    Joined:
    May 19, 2016
    Posts:
    9
  6. bobdonovan

    bobdonovan

    Unity Technologies

    Joined:
    Aug 2, 2017
    Posts:
    14
    Vencarii is right about this script ^^. Sorry for the confusion. To clarify, we did fix all issues involving serialization (in Animation and shader graph amongst others) bug 1065595,1073448 and 10789361 making sure all serialization code is always using 'CultureInfo.InvariantCulture'. The UI however is using the OS locale since .NET 4.6 went out of experimental and became the default .NET version.
     
    Qbit86 and codestage like this.
  7. gresolio

    gresolio

    Joined:
    Jan 5, 2014
    Posts:
    15
  8. DrEvil

    DrEvil

    Joined:
    Aug 11, 2012
    Posts:
    18
  9. Martichoras

    Martichoras

    Joined:
    Aug 8, 2017
    Posts:
    1
    We have experienced the same problem with our udp-script, however it does not generate any error
    int.TryParse(text, out speed);
    simply does not give an output.

    By using
    System.Globalization.NumberStyles.Number, CultureInfo.CurrentCulture.NumberFormat
    we have managed to get it to work in previous versions of unity (including 2017.2.0f3, 2018.1.0f2, 2018.2.0b9), but from Unity 2018.3 and forward
    TryParse()
    is not working with .Net 4x.. However, when rolling back to api compatability level 2.0, it works like a charm in 2018.3, but generate a lot of errors in 2019.1.

    I get a feeling the problem we experience is related to the one mentioned in this post. We have tried @gresolio 's solution both in 2018 and 2019, but it doesn't seem to work.

    Any solution to this?

    Code (CSharp):
    1.     private void ReceiveData()
    2.     {
    3.        
    4.         client = new UdpClient(port);
    5.         while (true)
    6.         {
    7.  
    8.             try
    9.             {
    10.                 IPEndPoint anyIP = new IPEndPoint(IPAddress.Any, 0);
    11.                 byte[] data = client.Receive(ref anyIP);
    12.  
    13.                 string text = Encoding.UTF8.GetString(data);
    14.  
    15.                 int.TryParse(text, out speed); // ORIGINAL, USED TO WORK!
    16.                
    17.                 //int.TryParse(text, System.Globalization.NumberStyles.Number, CultureInfo.CurrentCulture.NumberFormat, out speed);
    18.  
    19.                 lastReceivedUDPPacket = text;
    20.                 allReceivedUDPPackets = allReceivedUDPPackets+text;
    21.                
    22.             }
    23.             catch (Exception err)
    24.             {
    25.                 print(err.ToString());
    26.             }
    27.         }
    28.     }
     
  10. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    4,412
    Could you please submit a bug-report as described in this document:
    https://unity3d.com/unity/qa/bug-reporting

    It's important that you report these issues together with a reproduction project if you want them to get fixed. If you don't do it, it might be a long time until someone else reports them or until Unity Technologies find them.

    After you submitted the bug-report, you receive a confirmation email with a bug-report Case number. Please post the Case number (number only, not the link) in this forum thread for Unity staff to pick up.
     
  11. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,161
    Just stumbled upon this bug, and it's pretty bad. Have the old OBJ exporter script broken, because it now prints commas into the file lol.
    Furthermore, the behaviour is inconsistent with my Windows settings. Even though my region is set to "Russia", I always make sure the system-wide decimal symbol is set to ".":

    upload_2019-5-18_12-56-43.png

    Unity doesn't seem to respect that.
     
  12. Berno

    Berno

    Joined:
    Oct 29, 2014
    Posts:
    16
    Still broken in 2018.4.0f1 windows standalone runtime.
    My app has an editor and Input Fields with decimal places are broken when reading the values using float.parse in Germany and most likely other locales that use comma instead of decimal.
    Will this be back ported from 2019?