Skip to content

Commit

Permalink
Add line endings normalization
Browse files Browse the repository at this point in the history
Since template files (Assets/Terasurware/Editor/EntityTemplate*.txt) have `\n` (0x0a) as line ending, output of ExcelImporterMaker contains different line endings (`0x0a` for template part, `0x0d,0x0a` for generated part(`StringBuilder.AppendLine()`)) in Windows environment.
This changeset fixes it by normalizing and replacing line endings properly.
  • Loading branch information
Takayuki MATSUOKA committed Jul 17, 2017
1 parent c176848 commit 9def415
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Assets/Terasurware/Editor/ExcelImporterMaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ void ExportEntity()
{
string templateFilePath = (sepalateSheet) ? "Assets/Terasurware/Editor/EntityTemplate2.txt" : "Assets/Terasurware/Editor/EntityTemplate.txt";
string entittyTemplate = File.ReadAllText(templateFilePath);
entittyTemplate = entittyTemplate.Replace("\r\n", "\n").Replace("\n", System.Environment.NewLine);
StringBuilder builder = new StringBuilder();
bool isInbetweenArray = false;
foreach (ExcelRowParameter row in typeList)
Expand Down

0 comments on commit 9def415

Please sign in to comment.