wchar

    0熱度

    1回答

    我想轉換爲wchar_t *爲char *和我的記憶中浪費的解決辦法是 char *wstrtostr(const wchar_t *text) { size_t size = wcslen(text)*sizeof(wchar_t)+1; char *sa = malloc(size); wcstombs(sa,text,size); return sa;

    -1熱度

    1回答

    我正在用C++編寫一個程序,它必須處理unicode字符。 主要的問題是我使用的算法,我需要通過焦炭解析我的S/wstrings 字符: std::wstring word = L"Héllo" for (auto &e : word) // doing something with e 但是,如果我運行此: std::wstring word = L"Héllo" for (auto

    -1熱度

    1回答

    我正在做一個win32應用程序,並有一個接受unicode文本輸入的編輯控件。我用下面的代碼來獲取文本到std::string: WCHAR out[50] = {}; GetDlgItemTextW(hwnd, ID_Edit, out, 50); wstring myWString(out); string myString(ws.begin(), ws.end()); 在dubug

    -3熱度

    1回答

    我使用C/C++,是否有任何窗口函數或任何非常快速的方法將標題中的任何類型轉換爲const WCHAR *? 因此,我有一個大案例,在我需要將數據轉換爲WCHAR *的某個分支後,檢查我的數據是什麼類型。 因此,例如,如果我有 21,我希望它是L「21」。 32.322 => L「32.322」 等 我可以手動做,但我更喜歡它,如果有一些更快的方法!這些轉換似乎在一些較低級別上發生了很多。 謝謝!

    1熱度

    2回答

    我試圖寫使用以下代碼包含「阿爾法= ABCD」到一個文本文件的消息: #include <stdio.h> #include <wchar.h> int main() { const wchar_t *a = L"abcd", *msg = L"alpha = %s\n"; FILE *f = fopen("./deleteme", "a");

    6熱度

    1回答

    GCC 4.8,5.1,6.2和3.8.1鏘在Ubuntu 16.10與-std=c11,-std=c++11,-std=c++14,和-std=c++17都表現出這種怪異的行爲setlocale(LC_ALL, "any_THING.utf8");後使用fgetws(buf, (int) bufsize, stdin)時。 實施例的程序: #include <locale.h> #includ

    2熱度

    1回答

    我想把日誌記錄在python python項目中。爲此,我在我的common.py中寫了一個名爲get_logger的方法,它返回記錄器。 import logging def get_logger(name='app'): log_config = config.LOG_CONFIG logging.config.dictConfig(log_config) lo

    0熱度

    1回答

    是否有任何C/C++ 11等 whcar_t* source,destiantion; int location; copy(source,destination,location,partOfSource); 功能即拷貝partOfSource WCHAR-S從源到目的地,從目的地的位置開始,源地址爲0,沒有終止L'\ 0'的目標字符串? 謝謝!

    1熱度

    2回答

    我想使用UNICODE_STRING的緩衝區,但似乎我不能直接使用它,通過複製引用,因爲有時我可以看到在字符串中間有空字節,和Length大於我在調試器中看到的。所以,如果我這樣做 UNICODE_STRING testStr; //after being used by some function it has data like this 'bad丣\0more_stuff\0' wch

    2熱度

    3回答

    我寧願讓我的下列方式結構化的XML文檔: <root> <node info1="blah" info2="blah" /> <node info1="blah" info2="blah" /> </root> 相反的: <root> <node> <info1>blah</info1> <info2>blah</info2>