Skip to content

Commit

Permalink
Fix handling of some CJK characters with FIOS\LIOS name generation
Browse files Browse the repository at this point in the history
  • Loading branch information
bcssov committed Jul 22, 2023
1 parent d0caa8d commit 7da9204
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// ***********************************************************************

// ***********************************************************************
// Assembly : IronyModManager.IO
// Author : Mario
// Created : 04-04-2020
//
// Last Modified By : Mario
// Last Modified On : 11-14-2022
// Last Modified On : 07-22-2023
// ***********************************************************************
// <copyright file="BaseDefinitionInfoProvider.cs" company="Mario">
// Mario
Expand All @@ -23,6 +24,7 @@

namespace IronyModManager.IO.Mods.InfoProviders
{

/// <summary>
/// Class BaseDefinitionInfoProvider.
/// Implements the <see cref="IronyModManager.IO.Common.Mods.IDefinitionInfoProvider" />
Expand Down Expand Up @@ -160,7 +162,7 @@ protected virtual string EnsureRuleEnforced(IDefinition definition, string propo
if (isFIOS)
{
fileNames = fileNames.OrderBy(p => p, StringComparer.Ordinal).ToList();
var characterPrefix = Path.GetFileName(fileNames.FirstOrDefault()).First();
var characterPrefix = Path.GetFileName(fileNames.FirstOrDefault()).ToCharArray().OrderBy(p => (int)p).First();
string newFileName = proposedFilename;
while (definition.GeneratedFileNames.Any(f => f.Equals(fileNames.FirstOrDefault())))
{
Expand All @@ -178,7 +180,7 @@ protected virtual string EnsureRuleEnforced(IDefinition definition, string propo
else
{
fileNames = fileNames.OrderByDescending(p => p, StringComparer.Ordinal).ToList();
var characterPrefix = Path.GetFileName(fileNames.FirstOrDefault()).First();
var characterPrefix = Path.GetFileName(fileNames.FirstOrDefault()).ToCharArray().OrderByDescending(p => (int)p).First();
string newFileName = proposedFilename;
while (definition.GeneratedFileNames.Any(f => f.Equals(fileNames.FirstOrDefault())))
{
Expand Down

0 comments on commit 7da9204

Please sign in to comment.