-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1133 from kenjiuno/fix-ctd-editor-1
Fix text encoder/decoder of CtdEditor.
- Loading branch information
Showing
26 changed files
with
1,015 additions
and
431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
using OpenKh.Bbs.Messages.Internals; | ||
using OpenKh.Bbs.Messages.Internals; | ||
|
||
namespace OpenKh.Bbs.Messages | ||
{ | ||
public static class CtdEncoders | ||
{ | ||
public static ICtdMessageEncoder International { get; } = | ||
new InternationalCtdEncoder(); | ||
|
||
public static ICtdMessageEncoder Japanese { get; } = | ||
new InternationalCtdEncoder(); | ||
/// <summary> | ||
/// The unified CTD message encoder and decoder fit for both International and Japanese usage. | ||
/// </summary> | ||
public static ICtdMessageEncoder Unified { get; } = | ||
new UnifiedCtdEncoder(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace OpenKh.Bbs.Messages | ||
{ | ||
public class CtdFromTextOptions | ||
{ | ||
/// <summary> | ||
/// Encode input as Shift_JIS encoding. | ||
/// </summary> | ||
public bool EncodeAsShiftJIS { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace OpenKh.Bbs.Messages | ||
{ | ||
public class CtdToTextOptions | ||
{ | ||
/// <summary> | ||
/// Allow to decode unknown as `{:unk FF}` alternative instead of throwing an exception. | ||
/// </summary> | ||
public bool AllowUnkUsage { get; set; } = true; | ||
|
||
/// <summary> | ||
/// Decode input as Shift_JIS encoding. | ||
/// </summary> | ||
public bool DecodeAsShiftJIS { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
namespace OpenKh.Bbs.Messages | ||
namespace OpenKh.Bbs.Messages | ||
{ | ||
public interface ICtdMessageDecode | ||
{ | ||
string ToText(byte[] data); | ||
string ToText(byte[] data, CtdToTextOptions opts = null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
namespace OpenKh.Bbs.Messages | ||
namespace OpenKh.Bbs.Messages | ||
{ | ||
public interface ICtdMessageEncode | ||
{ | ||
byte[] FromText(string text); | ||
byte[] FromText(string text, CtdFromTextOptions opts = null); | ||
} | ||
} |
201 changes: 0 additions & 201 deletions
201
OpenKh.Bbs/Messages/Internals/InternationalCtdEncoder.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.