Skip to content

Commit

Permalink
Write extended strings correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchLeaders committed Jan 28, 2024
1 parent 72fe6ca commit e1304a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/BymlLibrary/BymlLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Revrs" Version="1.0.1" />
<PackageReference Include="Revrs" Version="1.0.2" />
<PackageReference Include="Syroot.BinaryData" Version="5.2.2" />
<PackageReference Include="Syroot.Maths" Version="1.5.3" />
<PackageReference Include="YamlDotNet" Version="15.1.0" />
Expand Down
3 changes: 2 additions & 1 deletion src/BymlLibrary/Writers/BymlWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using BymlLibrary.Structures;
using Revrs;
using System.Runtime.CompilerServices;
using System.Text;

namespace BymlLibrary.Writers;

Expand Down Expand Up @@ -192,7 +193,7 @@ public int WriteStringTable(ref Dictionary<string, int> strings)
int previousStringOffset = ((strings.Count + 1) * sizeof(uint)) + BymlContainer.SIZE;
Writer.Write(previousStringOffset);
foreach (var str in strings.Keys) {
Writer.Write(previousStringOffset += str.Length + 1);
Writer.Write(previousStringOffset += Encoding.UTF8.GetByteCount(str) + 1);
}

foreach (var str in strings.Keys) {
Expand Down

0 comments on commit e1304a2

Please sign in to comment.