Search Unity

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,859
    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
     
  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
     
    briant_001 likes this.
  5. eRobda

    eRobda

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

    thezzw

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

    Kurbot

    Joined:
    Apr 30, 2014
    Posts:
    2
    worked for me also
     
  8. poiuminaj

    poiuminaj

    Joined:
    Aug 3, 2021
    Posts:
    3
    thanks!
     
  9. Mayamamaicez

    Mayamamaicez

    Joined:
    Jul 27, 2018
    Posts:
    2
    A mi también me funciono, puse las dll en una carpeta 'Plugins' en Assets de mi proyecto. Una locura que esto este pasando
     
    achimmihca likes this.
  10. WeilleTheWeener

    WeilleTheWeener

    Joined:
    Sep 6, 2018
    Posts:
    1
    i have the same exception, it raises on connection.open with mssql, i fixed the problem on windows by copying l18N.dll and i18N.West.dll from unityjit-win32 folder but the issue continues on android, any ideas on fixing it?
     
  11. DavidExoMilot

    DavidExoMilot

    Joined:
    Mar 25, 2022
    Posts:
    3
    I just finished running into this issue as well and the fix worked for me. Make sure you import the two DLL files within Unity so it shows up in your project. Thanks!
     
    Last edited: Feb 20, 2024