Use of the L prefix for wide strings in resource files

Reece Dunn msclrhd at
Sun Dec 5 09:10:11 CST 2010

On 5 December 2010 14:09, Paul Vriens < at> wrote:
> Hi,
> Yaron just made me aware of something he and I discussed briefly a few weeks
> ago.
> The shlwapi resource files uses the following:
>  PUSHBUTTON L"&OK", IDOK, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP
>  PUSHBUTTON L"&Cancel", IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP
>  PUSHBUTTON L"&Yes", IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP
>  PUSHBUTTON L"&No", IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP
> There doesn't seem to be an issue with most of the languages as our resource
> compiler seem to do things just right.
> I did however see strangeness for some languages and also the not yet
> submitted Hebrew translation (maybe more?):
> ResHacker shows the same strangeness so it appears not only to be the
> translation site.
> Any idea where to start looking?

The Cancel button in Japanese looks like raw ShiftJIS in windows 1252
or utf8 encoding.

What appears to be happening is:
  1/  the localised strings are being converted to their multi-byte
representation (e.g. ShiftJIS for the Japanese (lang=011) text)
  2/  the multi-byte string is being encoded in the resource codepage (utf8?)

This would make sense if the L"..." string is going through
MultiByteToWideCharacter with the ShiftJIS encoding (for Japanese) and
then the resource is assuming this is utf8 (or whatever the resource
file codepage is) and is going through MultiByteToWideCharacter for
that as well.

I can't recognise the latin character sequences in the Cyrillic
dialogs (lang 022); these may be the utf8 sequences.

- Reece

More information about the wine-devel mailing list