No announcement yet.

Creating JSON file with UTF-8 Encoding for Adobe After Effects 2018

  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating JSON file with UTF-8 Encoding for Adobe After Effects 2018

    Im Trying to build a JSON File (For Adobe After Effects CC 2018 v15.0.1) from inputs entry and it worked perfectly except the encoding part for arabic language.

    My Script :

    Bullet1 = Input.GetText("Input1");
    Bullet2 = Input.GetText("Input2");
    Bullet3 = Input.GetText("Input3");
    Bullet4 = Input.GetText("Input4");

    JSON = "\[\n\t{\n\t\t"Bullet1": "".. Bullet1 .. ""," .. "\n\t\t"Bullet2": "".. Bullet2 .. ""," .. "\n\t\t"Bullet3": "".. Bullet3 .. ""," .. "\n\t\t"Bullet4": "".. Bullet4 .. ""\n\t},\n\t{\n\t\t"Bu1let1": ""\n\t}\n\]";

    TextFile.WriteFromString("D:\\MyFile.txt", JSON, false);

    --Encoding.ConvertFile("D:\\MyFile.txt", "iso-8859-1", "D:\\MyFile.txt", "utf-8"); \\ I tried this encoding script but it didnt work.
    --Encoding.WriteFromString("D:\\MyFile.txt", JSON, "utf-8", "iso-8859-1"); \\ Also tried this encoding script but it didnt work.

    File.Rename("D:\\MyFile.txt", "D:\\arabic.json");

    note that i used all encoding formats but it didnt work
    if you open the JSON file in text editor it will appear normal and arabic is working, but it will not work in after effects unless its UTF-8 for arabic.

    The file is working in english but not in arabic if its not UTF-8 (for Adobe After effects CC2018 15.0.1)

    Hope someone can help especially Ulrich

  • #2
    AMS is not that great when it comes to languages it was writing in ANSI so you need another option to there is no Encoding function that I know of, Ulrich might be able to point you in the right direction here tho he's the star on ams and encoding
    Plugins or Sources MokoX
    BunnyHop Here


    • #3
      Thank you Kingzooly for your reply,

      Every is working and my way was perfect till I noticed that after effects will not accept the JSON in arabic except its encoded in UTF-8, I posted it hoping Ulrich can help since he is the expert in this field and has an encoding plugin for AMS.


      • #4
        One Important Note, that file worked to be encoded in UTF-8 Format but the exact problem is in the (from) part in Blue.

        Encoding.WriteFromString("D:\\MyFile.txt", JSON, "utf-8", "iso-8859-1")

        Click image for larger version

Name:	UTF-8.JPG
Views:	261
Size:	39.9 KB
ID:	299571


        • #5
          Try "windows-1256" as the toEncoding.



          • #6
            Didn't work and it gives an empty file.
            please look at the project file to see if there is something wrong.

            Best Regards
            Attached Files


            • #7
              Your input and output streams have the same name, which is an error. Use this instead:
              Encoding.ConvertFile("D:\\MyFile.txt", "windows-1256", "D:\\MyFile-utf.txt", "utf-8");


              • #8
                Amazing man. You are the Hero. I wish it converts the same file (is this possible ?), but its not a big issue ill make a change in the workflow.

                Again i thank you so much for your help, you made my day.