Skip to content

Commit

Permalink
Track changes to the Charset.
Browse files Browse the repository at this point in the history
  • Loading branch information
HarryCordewener committed Feb 3, 2024
1 parent 3589602 commit d1ee5ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>

<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public partial class TelnetInterpreter

private Func<IEnumerable<EncodingInfo>, IOrderedEnumerable<Encoding>> _charsetOrder = (x) => x.Select(y => y.GetEncoding()).OrderBy(z => z.EncodingName);

private Func<Encoding, Task> SignalCharsetChangeAsync { get; set; }

public Lazy<byte[]> SupportedCharacterSets { get; }

/// <summary>
Expand Down Expand Up @@ -226,6 +228,7 @@ private async Task CompleteCharsetAsync(StateMachine<State, Trigger>.Transition
byte[] postAmble = [ (byte)Trigger.IAC, (byte)Trigger.SE ];

CurrentEncoding = chosenEncoding;
await (SignalCharsetChangeAsync?.Invoke(CurrentEncoding) ?? Task.CompletedTask);

// TODO: The implementing Server or Client needs to be warned when CurrentEncoding is set!
// This would allow, for instance, the Console to ensure it displays Unicode correctly.
Expand Down

0 comments on commit d1ee5ef

Please sign in to comment.