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.

Bug Very weird bug related to unity's serialization(?)

Discussion in 'Localization Tools' started by Czpal, Mar 28, 2023.

  1. Czpal

    Czpal

    Joined:
    Feb 2, 2019
    Posts:
    14
    I've been using unity's localization for a while and the project has quite a lot of keys in the tables by now. I think I've hit a really weird edge case which broke unity's serialization. While working on my game I started getting weird errors:
    "Unable to parse file X [Parser Failure at line Y: Expect ':' between key and value within mapping]"
    where X is a string table asset.
    Tried restarting the project, reimporting the assets. Nothing helped.

    I checked the line number mentioned in the error and I found this in the asset file:

    m_Localized: "\u6539\u9020\u30A2\u30A4\u30C6\u30E0\u304C\u3042\u308A\u307E\u305B\u3093\nID:
    {0}\n\u30E2\u30C3\u30C9\u540D: {1}\nMod guid: {2}"

    It's really weird as it appears as if the ":" in the localized text somehow breaks the parser. In the end I fixed it by clearing the m_Localized value in the asset and using a slightly different text for this entry.

    Out of curiosity I tried creating a new entry in the string table with the following text.
    改造アイテムがありません
    ID: {0}
    モッド名: {1}
    Mod guid: {2}

    And the error appeared again. Very weird. I'm using Unity 2020.3.38f1 with localization package 1.4.3
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,388
    That sounds very strange, as you say, it's likely an issue in the serializer. Are you able to file a bug report so we can get it looked at?
     
    Last edited: Mar 29, 2023
  3. Czpal

    Czpal

    Joined:
    Feb 2, 2019
    Posts:
    14
    I will try to reproduce it on a minimal project and file a bug report if I find some time. Very busy working on a new update of my game now though, so probably not very soon.
     
    karl_jones likes this.
  4. lixi_x

    lixi_x

    Unity Technologies

    Joined:
    May 5, 2021
    Posts:
    9
    I have created a ticket for the serialization team :) Thanks for reporting it!
    https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-31947
     
    Last edited: Mar 29, 2023
    Czpal and karl_jones like this.