Bug 2528 - windres language enhancement and fix
Summary: windres language enhancement and fix
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.16
: P2 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-08 10:45 UTC by Dmitry I. Yanushkevich
Modified: 2006-04-22 08:45 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
a patch for windres to make multilingual resources possible (2.73 KB, patch)
2006-04-08 10:48 UTC, Dmitry I. Yanushkevich
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry I. Yanushkevich 2006-04-08 10:45:11 UTC
basically it concerns multilangual and unicode conversion issues on Win32 
targets.

windres does not allow to build unicode resources in normal way. for example, 
when you try to build app which has english, russian and, for example, japanese 
menu items and strings, the result is pretty funny... you won't see russian & 
japanese, though LANGUARE prop is correctly defined.

i've reworked winduni.c & other source files to produce results depending on 
current resource language defined by LANGUAGE property. there's some work that 
still should be done: define default codepages for other languages (there's only 
russian and japanese in the patch), but that should be easy to do.

patch url: http://www.dark-across.info/binutils-2.16.1-windres-multilang.patch

thanks. hope that'll help.
Comment 1 Dmitry I. Yanushkevich 2006-04-08 10:48:20 UTC
Created attachment 960 [details]
a patch for windres to make multilingual resources possible
Comment 2 Danny Smith 2006-04-22 08:45:51 UTC
Thanks for the patch.

Please see also:
http://sources.redhat.com/bugzilla/show_bug.cgi?id=576

Do you have a copyright-assignment on file for binutils.  If no you will need 
to complete some paperwork.

Also, wouldn't this be a better way to get codepage for langid on windows?

#ifdef _WIN32
#include <windows.h>

static unsigned int
codepage_from_langid (unsigned short langid)
{
  const int buf_len = 6;
  char cp_string [buf_len];
  int c;
  memset (cp_string, 0, buf_len);
  c = GetLocaleInfoA (MAKELCID (langid, SORT_DEFAULT),
		      LOCALE_IDEFAULTANSICODEPAGE,
		      cp_string,  buf_len);
  /* If codepage data for an LCID is not installed on users's system,
     GetLocaleInfo returns an empty string.  Fall back to system ANSI
     default. */
  if ( c == 0 )
    return CP_ACP;
  return strtoul (cp_string, 0, 10);
}
#endif

Danny