Ignore:
Timestamp:
Dec 27, 1999, 7:42:49 PM (26 years ago)
Author:
sandervl
Message:

VT's codepage changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/unicode.cpp

    r1986 r2213  
    1 /* $Id: unicode.cpp,v 1.19 1999-12-05 21:11:40 sandervl Exp $ */
     1/* $Id: unicode.cpp,v 1.20 1999-12-27 18:42:25 sandervl Exp $ */
    22
    33/*
     
    1717#include <string.h>
    1818#include "misc.h"
     19#include "codepage.h"
    1920#include <unicode.h>
    2021
    21 static UconvObject uconv_object = NULL;
     22/*static UconvObject uconv_object = NULL;*/
     23/*
    2224BOOL getUconvObject( void )
    2325{
     
    4042  return ret;
    4143}
    42 
     44*/
    4345/***********************************************************************
    4446 *              MultiByteToWideChar                (KERNEL32.534)
     
    200202  return(TRUE);
    201203}
     204
    202205//******************************************************************************
    203206// unilen: length of astring buffer (including 0 terminator)
    204207// returns string length
    205208//******************************************************************************
    206 int WIN32API UnicodeToAsciiN(LPCWSTR ustring, char *astring, int unilen)
     209int UnicodeToCodepageN(LPCWSTR ustring, char *astring, int unilen, UconvObject uconv_object)
    207210{
    208211  int i;
     
    227230//  unilen = min(length, unilen);
    228231
    229   if (getUconvObject())
     232  if (uconv_object)
    230233  {
    231234    if (unilen == 1)
     
    264267  }
    265268}
     269
     270int WIN32API UnicodeToAsciiN(LPCWSTR ustring, char *astring, int unilen)
     271{
     272    return UnicodeToCodepageN(ustring, astring, unilen, GetWindowsUconvObject());
     273}
     274
    266275//******************************************************************************
    267276// Converts unicode string to ascii string
     
    327336// asciilen: max length of unicode buffer (including end 0)
    328337//******************************************************************************
    329 void WIN32API AsciiToUnicodeN(const char *ascii, WCHAR *unicode, int asciilen)
     338void CodepageToUnicodeN(const char *ascii, WCHAR *unicode, int asciilen, UconvObject uconv_object)
    330339{
    331340  int rc;
     
    352361
    353362//  dprintf(("KERNEL32: AsciiToUnicodeN %s\n", ascii));
    354   if (getUconvObject())
     363  if (uconv_object)
    355364  {
    356365    if (asciilen == 1)
     
    389398  }
    390399}
     400
     401void WIN32API AsciiToUnicodeN(const char *ascii, WCHAR *unicode, int asciilen)
     402{
     403    CodepageToUnicodeN(ascii, unicode, asciilen, GetWindowsUconvObject());
     404}
     405
     406
    391407//******************************************************************************
    392408// Copies the full string from ascii to unicode
Note: See TracChangeset for help on using the changeset viewer.