當前位置: 首頁>>代碼示例>>C++>>正文


C++ CharToOemBuffW函數代碼示例

本文整理匯總了C++中CharToOemBuffW函數的典型用法代碼示例。如果您正苦於以下問題:C++ CharToOemBuffW函數的具體用法?C++ CharToOemBuffW怎麽用?C++ CharToOemBuffW使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CharToOemBuffW函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: vutf8printf

void vutf8printf(FILE *out, const char *str, va_list* ap)
{
#if PLATFORM == PLATFORM_WINDOWS
    char temp_buf[32*1024];
    wchar_t wtemp_buf[32*1024];

    size_t temp_len = vsnprintf(temp_buf, 32*1024, str, *ap);

    size_t wtemp_len = 32*1024-1;
    Utf8toWStr(temp_buf, temp_len, wtemp_buf, wtemp_len);

    CharToOemBuffW(&wtemp_buf[0], &temp_buf[0], wtemp_len+1);
    fprintf(out, "%s", temp_buf);
#else
    vfprintf(out, str, *ap);
#endif
}
開發者ID:BlackBarryProject,項目名稱:Mangos,代碼行數:17,代碼來源:Util.cpp

示例2: CharToOemBuffW

void CmdExtract::ConvertDosPassword(Archive &Arc,SecPassword &DestPwd)
{
  if (Arc.Format==RARFMT15 && Arc.FileHead.HostOS==HOST_MSDOS)
  {
    // We need the password in OEM encoding if file was encrypted by
    // native RAR/DOS (not extender based). Let's make the conversion.
    wchar PlainPsw[MAXPASSWORD];
    Password.Get(PlainPsw,ASIZE(PlainPsw));
    char PswA[MAXPASSWORD];
    CharToOemBuffW(PlainPsw,PswA,ASIZE(PswA));
    PswA[ASIZE(PswA)-1]=0;
    CharToWide(PswA,PlainPsw,ASIZE(PlainPsw));
    DestPwd.Set(PlainPsw);
    cleandata(PlainPsw,sizeof(PlainPsw));
    cleandata(PswA,sizeof(PswA));
  }
}
開發者ID:codepongo,項目名稱:sumatrapdf,代碼行數:17,代碼來源:extract.cpp

示例3: utf8print

void utf8print(void* /*arg*/, const char* str)
{
#if PLATFORM == PLATFORM_WINDOWS
    wchar_t wtemp_buf[6000];
    size_t wtemp_len = 6000-1;
    if (!Utf8toWStr(str, strlen(str), wtemp_buf, wtemp_len))
        return;

    char temp_buf[6000];
    CharToOemBuffW(&wtemp_buf[0], &temp_buf[0], wtemp_len+1);
    printf(temp_buf);
#else
{
    printf("%s", str);
    fflush(stdout);
}
#endif
}
開發者ID:BAndysc,項目名稱:SkyFireEMU_406a,代碼行數:18,代碼來源:CliRunnable.cpp

示例4: vutf8printf

void vutf8printf(FILE* file, const char* fmt, va_list& args)
{
#if PLATFORM == PLATFORM_WINDOWS
    #define BUFFER_LENGTH 32 * 1024
    char temp_buf[BUFFER_LENGTH];
    wchar_t wtemp_buf[BUFFER_LENGTH];

    size_t temp_len = vsnprintf(temp_buf, BUFFER_LENGTH, fmt, args);

    size_t wtemp_len = BUFFER_LENGTH - 1;
    Utf8toWStr(temp_buf, temp_len, wtemp_buf, wtemp_len);

    CharToOemBuffW(&wtemp_buf[0], &temp_buf[0], wtemp_len + 1);
    fprintf(file, "%s", temp_buf);
#else
    vfprintf(file, fmt, args);
#endif
}
開發者ID:Bes666,項目名稱:TrilliumEMU,代碼行數:18,代碼來源:Util.cpp

示例5: vutf8printf

void vutf8printf(FILE* out, const char *str, va_list* ap)
{
#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
    char temp_buf[32 * 1024];
    wchar_t wtemp_buf[32 * 1024];

    size_t temp_len = vsnprintf(temp_buf, 32 * 1024, str, *ap);
    //vsnprintf returns -1 if the buffer is too small
    if (temp_len == size_t(-1))
        temp_len = 32*1024-1;

    size_t wtemp_len = 32*1024-1;
    Utf8toWStr(temp_buf, temp_len, wtemp_buf, wtemp_len);

    CharToOemBuffW(&wtemp_buf[0], &temp_buf[0], uint32(wtemp_len + 1));
    fprintf(out, "%s", temp_buf);
#else
    vfprintf(out, str, *ap);
#endif
}
開發者ID:SuetyPoet,項目名稱:pgcompcore,代碼行數:20,代碼來源:Util.cpp

示例6: vutf8printf

void vutf8printf(FILE* out, const char* str, va_list* ap)
{
#if PLATFORM == PLATFORM_WINDOWS
    std::string temp_buf;
    temp_buf.resize(32 * 1024);
    std::wstring wtemp_buf;

    size_t temp_len = vsnprintf(&temp_buf[0], 32 * 1024, str, *ap);
    temp_buf.resize(strlen(temp_buf.c_str())); // Resize to match the formatted string

    if (!temp_buf.empty())
    {
        Utf8toWStr(temp_buf, wtemp_buf, 32 * 1024);
        wtemp_buf.push_back('\0');

        CharToOemBuffW(&wtemp_buf[0], &temp_buf[0], wtemp_buf.size());
    }
    fprintf(out, "%s", temp_buf.c_str());
#else
    vfprintf(out, str, *ap);
#endif
}
開發者ID:lduguid,項目名稱:mangos-tbc,代碼行數:22,代碼來源:Util.cpp

示例7: CharToOemW

/***********************************************************************
 *           CharToOemW   ([email protected])
 */
BOOL WINAPI CharToOemW( LPCWSTR s, LPSTR d )
{
    return CharToOemBuffW( s, d, strlenW( s ) + 1 );
}
開發者ID:howard5888,項目名稱:wineT,代碼行數:7,代碼來源:lstr.c


注:本文中的CharToOemBuffW函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。