Forum rules - please read before posting.

Translation export - windows-style newlines break CSV

Windows-style CRLF newlines break CSV export, as the CR is not replaced which creates problems when importing the resulting CSV into differnt programs, saving it, ...
E.g. simply loading the CSV into sublime text, changing a character, saving it, and AC will not load the CSV properly.
Apparently the CRLF problem is just exhibited on "Journal" menu items - in dialog fragments the newlines are properly normalized to LF.

AC Version 1.48b

Comments

  • I also just discovered that Unity is not very reliable when it comes to newlines. I guess it also depends on which platform the project was previously edited, e.g. our project has been authored on windows as well as macs. I just discovered there are plain CR used as newlines in some places (which if I remember correctly are the macos-style line endings).

    I'm currently emplying this fix myself when preparing text for CSV export:

    private string RemoveLineBreaks (string text)
    {
    return (text.Replace("\r\n""[break]").Replace("\n""[break]").Replace("\r""[break]"));
    }
  • Thank you.  How about the import?  Does the AddLineBreaks function also need to be modified?
  • Using normalized LF line breaks (as implemented) should be the safest bet when importing translations, haven't had problems yet with LF only.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.