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. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Resolved NotSupportedException: Encoding 1252 data could not be found (2020.2.3.f1)

Discussion in 'macOS' started by Slarti-42, Feb 15, 2021.

  1. Slarti-42

    Slarti-42

    Joined:
    Jul 1, 2019
    Posts:
    49
    Hi folks,

    I ran into the following problem (On 2020.2.3.f1 - MacOS):

    NotSupportedException: Encoding 1252 data could not be found. Make sure you have the correct international codeset assembly installed and enabled.


    From some very old posts on the web, I found that I have to put the I18N.dlls into my project, but this gave me then this problem:

    InvalidProgramException: Invalid IL code in I18N.Common.Manager:get_PrimaryManager (): IL_0000: ret


    From the internet, it looks like it is a MySql problem.

    In the editor, it runs fine.

    Anyone has an idea, please? I have attached the 2 logs with and without the dlls.

    Any hint is highly appreciated.
    Thanks, Slarti

    PS: Btw, I am aware of that last line:
    Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 11)

    which I haven't found out where it occurs. It didn't show up in the previous version.
     

    Attached Files:

    Seb_GTB likes this.
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,796
    Yes, you can tell from the stack trace that this is happening inside your MySql connection (via World.cs, ComponentSystemBase.cs, DatabaseToList.cs, etc.).

    If you have control over this MySQL database, you should try changing its encoding to UTF-8. Encoding 1252 is an ancient beast.
     
  3. Slarti-42

    Slarti-42

    Joined:
    Jul 1, 2019
    Posts:
    49
    thanks @JoeStrout

    The DB is using utf8mb4_general_ci. My guess is that Unity is requesting in 1252???

    Well, I found now the solution. https://answers.unity.com/questions/1756912/invalid-il-code-in-build.html

    Quite recent as well. I didn't see that before, as I had no filter in my search.

    In order to work, you have to copy the l18N.dll and the i18N.West.dll into your assets from Unity\Hub\Editor\2019.3.15f1\Editor\Data\MonoBleedingEdge\lib\mono\unityjit

    use unityjit and not unity, as the later one doesn't work.

    I wonder if there is something for Unity to do, or if this is an exception when using DB queries, so they don't have to do something about this.

    Thanks for the answer.
    Slarti
     
    SpyTeV, Seb_GTB, Haldar422 and 3 others like this.
  4. TheFastLane

    TheFastLane

    Joined:
    Aug 27, 2018
    Posts:
    5
    I was trying to create a font using iText7 and got that error for some reason.

    PdfFontFactory.CreateFont("roboto_regular.ttf",true)


    Now it works thanks to Slarti-42
     
    briant96 likes this.
  5. eRobda

    eRobda

    Joined:
    Feb 8, 2021
    Posts:
    2
    It worked for me, thank you so much!
     
  6. thezzw

    thezzw

    Joined:
    Jan 19, 2022
    Posts:
    2
    Worked for me too, thanks a lot.