Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
774 B
1
Indexable
Never
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool SetConsoleFont(IntPtr hOutput, uint fontIndex);

[DllImport("kernel32.dll", SetLastError = true)]
public static extern IntPtr GetStdHandle(int nStdHandle);

public const int STD_OUTPUT_HANDLE = -11;
public const uint Arabic_CodePage = 1256;

static void SetConsoleFont()
{
    IntPtr hOut = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleFont(hOut, Arabic_CodePage);
}

static void ProcessDataForSharePoint(ClientContext context, List targetList, string listName, DataTable databaseData, DataTable excelData)
{
    // Set console output encoding to UTF-8
    Console.OutputEncoding = Encoding.UTF8;

    // Set console font for Arabic support
    SetConsoleFont();

    // ... (rest of your code)
}
Leave a Comment