英語以外の文字で Moonshine (https://github.com/brandonc/moonshine) を使用する場合 - たとえば、次のテキストを実行する場合
The following is italic Arabic text: *مرحبا، كيف حالك اليوم؟*
パラメータ付きの github プロジェクトで提供されるコンソール アプリを介して
extensions = Sundown.MarkdownExtensions.NoIntraEmphasis | Sundown.MarkdownExtensions.FencedCode | Sundown.MarkdownExtensions.AutoLink smartypants = false
出力は次のとおりです。
<p>The following is italic Arabic text: <em>?????? ??? ???? ??????</em></p>
正しく戻すにはどうすればよいですか?
ありがとう
ムスタファ
編集:
そのため、Moonshine.cs ラッパーでは、Sundown ライブラリに渡されるバッファーが次のように定義されていることに気付きました。
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
struct buf
{
[MarshalAs(UnmanagedType.LPStr)]
public string data; /* actual character data */
public uint size; /* size of the string */
public uint asize; /* allocated size (0 = volatile buffer) */
public uint unit; /* reallocation unit size (0 = read-only buffer) */
public int @ref; /* reference count */
};
Charset
は として定義されAnsi
、は としてマーシャリングstring data
されますLPStr
。残念ながら、それをに変更します
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
struct buf
{
[MarshalAs(UnmanagedType.LPWStr)]
public string data; /* actual character data */
public uint size; /* size of the string */
public uint asize; /* allocated size (0 = volatile buffer) */
public uint unit; /* reallocation unit size (0 = read-only buffer) */
public int @ref; /* reference count */
};
受信した出力が正しくエンコードされていないテキストであるため、役に立ちません。
瀼吾栀攀 昀漀氀氀漀眀椀渀最 椀猀 戀漀氀搀 䄀爀愀戀椀挀 琀攀砀琀⼼㹰༊ҧÄȪ
再度、感謝します。