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

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

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?

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.

1 Like

I have created a ticket for the serialization team :slight_smile: Thanks for reporting it!
https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-31947

2 Likes