Alexandre Julliard <[EMAIL PROTECTED]> wrote:

>> Microsoft did not change format of NLS files for Win2000.
>> And as wrote in my mail
>> "1. Such functions as RtlCustomCPToUnicodeN and RtlUnicodeToCustomCPN (which
>> I propose to use in x11drv to support fonts that have encodings different
>> from Unicode/ANSI/OEM/Mac) have very strong dependence and will be never
>> implemented without that."
>
>Could you elaborate a bit?  What are these functions supposed to do
>exactly, and why do they depend on the NLS file format?

Here is a quote from the mail from Andrew Kozin - author of YAW:
(translation from Russian follows)

<QUOTE>

On 24-Feb-00 Dmitry Timoshkov wrote:
> Hi Andrey.
> 
> Would you help me with the following problem?
> 
> I can not find any information about RtlCustomCPToUnicodeN and
> RtlUnicodeToCustomCPN. I have searched the whole internet, including microsoft.com,
> but found nothing.

First of all you need to load *.nls and pass the pointer to this memory area
and the pointer to defined structure RTL_NLS_DATA

typedef struct _RTL_NLS_DATA
{
  WORD              codepage;             /* codepage */
  WORD              max_char_size;        /* maximum character size */
  WORD              default_char;         /* default character */
  WORD              char1;                /* */
  WORD              char2;                /* */
  WORD              char3;                /* */
  WORD              dbcs_flag;            /* 1 for DBCS, 0 for SBCS */
  struct _lb_range  lead_byte_range[6];   /* array of lead-byte ranges */
  WORD              reserved;             /* */
  WCHAR             *multibyte_2_unicode; /* multibyte-to-unicode table */
  char              *unicode_2_multibyte; /* unicode-to-multibyte table */
  ULONG             unknown;              /* */
  char              *dbcs_tags;           /* DBCS tags table */
}RTL_NLS_DATA;

Functions:

VOID WINAPI RtlInitCodePageTable
(
  VOID *nls_file,
  RTL_NLS_DATA *nls
);

It will fill fields of structure RTL_NLS_DATA with needed values.

And only then to use

NTSTATUS WINAPI RtlCustomCPToUnicode
(
  RTL_NLS_DATA *nls,
  WCHAR *Dst,
  DWORD Size,
  DWORD *pdwSize,
  CHAR *Src,
  DWORD Length
);

and

NTSTATUS WINAPI RtlUnicodeToCustomCPN
(
  RTL_NLS_DATA *nls,
  CHAR *Dst,
  DWORD Size,
  DWORD *pdwSize,
  WCHAR *Src,
  DWORD Length
);

</QUOTE>

Dependence is not quite obvious. But RtlInitCodePageTable() is
the part of NT's interface dealing with NLS files and tables.

Dmitry.

Reply via email to