[Aptitude-svn-commit] r3547 - in branches/aptitude-0.3/aptitude: . src

Daniel Burrows dburrows@costa.debian.org
Sat, 02 Jul 2005 16:03:47 +0000


Author: dburrows
Date: Sat Jul  2 16:03:44 2005
New Revision: 3547

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/pkg_grouppolicy.cc
   branches/aptitude-0.3/aptitude/src/pkg_grouppolicy.h
Log:
Update pkg_grouppolicy for wide characters.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sat Jul  2 16:03:44 2005
@@ -1,5 +1,9 @@
 2005-07-02  Daniel Burrows  <dburrows@debian.org>
 
+	* src/pkg_grouppolicy.cc, src/pkg_grouppolicy.h:
+
+	  Update pkg_grouppolicy for wide characters.
+
 	* src/pkg_item.cc, src/pkg_item.h:
 
 	  Update the pkg_item code for wide characters.

Modified: branches/aptitude-0.3/aptitude/src/pkg_grouppolicy.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/pkg_grouppolicy.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/pkg_grouppolicy.cc	Sat Jul  2 16:03:44 2005
@@ -25,6 +25,8 @@
 #include "pkg_item.h"
 #include "pkg_subtree.h"
 
+#include <vscreen/transcode.h>
+
 #include "generic/apt.h"
 #include "generic/pkg_hier.h"
 #include "generic/tasks.h"
@@ -46,10 +48,10 @@
 // Ok, it's a dreadful hack.  I admit it.
 class pkg_subtree_with_order:public pkg_subtree
 {
-  string my_tag;
+  wstring my_tag;
 public:
-  pkg_subtree_with_order(string name, string description,
-			 sigc::signal1<void, std::string> *_info_signal,
+  pkg_subtree_with_order(wstring name, wstring description,
+			 sigc::signal1<void, std::wstring> *_info_signal,
 			 unsigned char order, bool expand=false)
     :pkg_subtree(name, description, _info_signal, expand)
   {
@@ -57,14 +59,14 @@
     my_tag+=pkg_subtree::tag();
   }
 
-  pkg_subtree_with_order(string name, unsigned char order, bool expand=false)
+  pkg_subtree_with_order(wstring name, unsigned char order, bool expand=false)
     :pkg_subtree(name, expand)
   {
     my_tag+=order;
     my_tag+=pkg_subtree::tag();
   }
 
-  virtual const char *tag() const
+  virtual const wchar_t *tag()
   {
     return my_tag.c_str();
   }
@@ -107,7 +109,7 @@
   bool passthrough;
 
   // The descriptions are in the style used by package descriptions.
-  static hash_map<string, const char *> section_descriptions;
+  static hash_map<string, wstring> section_descriptions;
   static void init_section_descriptions();
 public:
   pkg_grouppolicy_section(int _split_mode,
@@ -137,7 +139,7 @@
 				     _sig, _desc_sig);
 }
 
-hash_map<string, const char *> pkg_grouppolicy_section::section_descriptions;
+hash_map<string, wstring> pkg_grouppolicy_section::section_descriptions;
 
 // Should this be externally configurable?
 void pkg_grouppolicy_section::init_section_descriptions()
@@ -147,52 +149,52 @@
   if(already_done)
     return;
 
-  section_descriptions["Tasks"]=_("Packages which set up your computer to perform a particular task\n Packages in the 'Tasks' section contain no files; they merely depend upon other packages. These packages provide an easy way to select a predefined set of packages for a specialized task.");
+  section_descriptions["Tasks"]=transcode(_("Packages which set up your computer to perform a particular task\n Packages in the 'Tasks' section contain no files; they merely depend upon other packages. These packages provide an easy way to select a predefined set of packages for a specialized task."));
 
-  section_descriptions["Unknown"]=_("Packages with no declared section\n No section is given for these packages. Perhaps there is an error in the Packages file?");
+  section_descriptions["Unknown"]=transcode(_("Packages with no declared section\n No section is given for these packages. Perhaps there is an error in the Packages file?"));
 
-  section_descriptions["admin"]=_("Administrative utilities (install software, manage users, etc)\n Packages in the 'admin' section allow you to perform administrative tasks such as installing software, managing users, configuring and monitoring your system, examining network traffic, and so on.");
+  section_descriptions["admin"]=transcode(_("Administrative utilities (install software, manage users, etc)\n Packages in the 'admin' section allow you to perform administrative tasks such as installing software, managing users, configuring and monitoring your system, examining network traffic, and so on."));
 
-  section_descriptions["alien"]=_("Packages converted from foreign formats (rpm, tgz, etc)\n Packages in the 'alien' section were created by the 'alien' program from a non-Debian package format such as RPM");
-  section_descriptions["base"]=_("The Debian base system\n Packages in the 'base' section are part of the initial system installation.");
-  section_descriptions["comm"]=_("Programs for faxmodems and other communications devices\n Packages in the 'comm' section are used to control modems and other hardware communications devices. This includes software to control faxmodems (for instance, PPP for dial-up internet connections and programs originally written for that purpose, such as zmodem/kermit), as well as software to control cellular phones, interface with FidoNet, and run a BBS.");
-  section_descriptions["devel"]=_("Utilities and programs for software development\n Packages in the 'devel' section are used to write new software and work on existing software. Non-programmers who do not compile their own software probably do not need much software from this section.\n .\n It includes compilers, debugging tools, programmer's editors, source processing tools, and other things related to software development.");
-  section_descriptions["doc"]=_("Documentation and specialized programs for viewing documentation\n Packages in the 'doc' section document parts of the Debian system, or are viewers for documentation formats.");
-  section_descriptions["editors"]=_("Text editors and word processors\n Packages in the 'editors' section allow you to edit plain ASCII text. These are not necessarily word processors, although some word processors may be found in this section.");
-  section_descriptions["electronics"]=_("Programs for working with circuits and electronics\n Packages in the 'electronics' section include circuit design tools, simulators and assemblers for microcontrollers, and other related software.");
-  section_descriptions["embedded"]=_("Programs for embedded systems\n Packages in the 'embedded' section are meant to run on embedded devices. Embedded devices are specialized hardware devices with much less power than a typical desktop system: for instance, a PDA, a cell phone, or a Tivo.");
-  section_descriptions["gnome"]=_("The GNOME Desktop System\n GNOME is a collection of software which provides an easy-to-use desktop environment for Linux.  Packages in the 'gnome' section are part of the GNOME environment or closely integrated into it.");
-  section_descriptions["games"]=_("Games, toys, and fun programs\n Packages in the 'games' section are meant primarily for entertainment.");
-  section_descriptions["graphics"]=_("Utilities to create, view, and edit graphics files\n Packages in the 'graphics' section include viewers for image files, image processing and manipulation software, software to interact with graphics hardware (such as video cards, scanners, and digital cameras), and programming tools for handling graphics.");
-  section_descriptions["hamradio"]=_("Software for ham radio operators\n Packages in the 'hamradio' section are meant primarily for ham radio operators.");
-  section_descriptions["interpreters"]=_("Interpreters for interpreted languages\n Packages in the 'interpreters' section include interpreters for languages like Python, Perl, and Ruby, and libraries for these same languages.");
-  section_descriptions["kde"]=_("The KDE Desktop System\n KDE is a collection of software which provides an easy-to-use desktop environment for Linux.  Packages in the 'kde' section are part of the KDE environment or closely integrated into it.");
-  section_descriptions["libdevel"]=_("Development files for libraries\n Packages in the 'libdevel' section contain files required for building programs that use libraries in the 'libs' section.  You don't need packages from this section unless you want to compile software yourself.");
-  section_descriptions["libs"]=_("Collections of software routines\n Packages in the 'libs' section provide necessary functionality for other software on the computer. With very few exceptions, you should not need to explicitly install a package from this section; the package system will install them as required to fulfill dependencies.");
-  section_descriptions["perl"]=_("Perl interpreter and libraries\n Packages in the 'perl' section provide the Perl programming language and many third-party libraries for it. Unless you are a Perl programmer, you don't need to install packages from this section explicitly; the package system will install them if they are required.");
-  section_descriptions["python"]=_("Python interpreter and libraries\n Packages in the 'python' section provide the Python programming language and many third-party libraries for it. Unless you are a Python programmer, you don't need to install packages from this section explicitly; the package system will install them if they are required.");
-  section_descriptions["mail"]=_("Programs to write, send, and route email messages\n Packages in the 'mail' section include mail readers, mail transport daemons, mailing list software, and spam filters, as well as various other software related to electronic mail.");
-  section_descriptions["math"]=_("Numeric analysis and other mathematics-related software\n Packages in the 'math' section include calculators, languages for mathematical computation (similar to Mathematica), symbolic algebra packages, and programs to visualize mathematical objects.");
-  section_descriptions["misc"]=_("Miscellaneous software\n Packages in the 'misc' section have too unusual a function to be classified.");
-  section_descriptions["net"]=_("Programs to connect to and provide various services\n Packages in the 'net' section include clients and servers for many protocols, tools to manipulate and debug low-level network protocols, IM systems, and other network-related software.");
-  section_descriptions["news"]=_("Usenet clients and servers\n Packages in the 'news' section are related to the Usenet distributed news system.  They include news readers and news servers.");
-  section_descriptions["oldlibs"]=_("Obsolete libraries\n Packages in the 'oldlibs' section are obsolete and should not be used by new software.  They are provided for compatibility reasons, or because software distributed by Debian still requires them.\n .\n With very few exceptions, you should not need to explicitly install a package from this section; the package system will install them as required to fulfill dependencies.");
-  section_descriptions["otherosfs"]=_("Emulators and software to read foreign filesystems\n Packages in the 'otherosfs' section emulate hardware and operating systems and provide tools for transferring data between different operating systems and hardware platforms. (for instance, utilities to read DOS floppies, and utilities to communicate with Palm Pilots)\n .\n It is worth noting that CD burning software is included in THIS section.");
-  section_descriptions["science"]=_("Software for scientific work\n Packages in the 'science' section include tools for astronomy, biology, and chemistry, as well as other science-related software.");
-  section_descriptions["shells"]=_("Command shells and alternative console environments\n Packages in the 'shells' section include programs providing a command-line interface.");
-  section_descriptions["sound"]=_("Utilities to play and record sound\n Packages in the 'sound' section include sound players, recorders, and encoders for many formats, mixers and volume controls, MIDI sequencers and programs to generate musical notation, drivers for sound hardware, and sound processing software.");
-  section_descriptions["tex"]=_("The TeX typesetting system\n Packages in the 'tex' section are related to TeX, a system for producing high-quality typeset output.  They include TeX itself, TeX packages, editors designed for TeX, utilities to convert TeX and TeX output files to various formats, TeX fonts, and other software related to TeX.");
-  section_descriptions["text"]=_("Text processing utilities\n Packages in the 'text' section include text filters and processors, spelling checkers, dictionary programs, utilities to convert between character encodings and text file formats (eg, Unix and DOS), text formatters and pretty-printers, and other software which operates on plain text.");
-  section_descriptions["utils"]=_("Various system utilities\n Packages in the 'utils' section are utilities whose purpose is too unique to be classified.");
-  section_descriptions["web"]=_("Web browsers, servers, proxies, and other tools\n Packages in the 'web' section include Web browsers, Web servers and proxies, software to write CGI scripts or Web-based programs, pre-written Web-based programs, and other software related to the World Wide Web.");
-  section_descriptions["x11"]=_("The X window system and related software\n Packages in the 'x11' section include the core packages for the X window system, window managers, utility programs for X, and miscellaneous programs with an X GUI which were placed here because they didn't fit anywhere else.");
-
-  section_descriptions["contrib"]=_("Programs which depend on software not in Debian\n Packages in the 'contrib' section are not part of Debian.\n .\n These packages are Free Software, but they depend on software which is not part of Debian.  This may be because it is not Free Software, but is packaged in the non-free section of the archive, because Debian cannot distribute it at all, or (in rare cases) because no-one has packaged it yet.\n .\n For more information about what Debian considers to be Free Software, see http://www.debian.org/social_contract#guidelines");
-  section_descriptions["main"]=_("The main Debian archive\n The Debian distribution consists of packages from the 'main' section. Every package in 'main' is Free Software.\n .\n For more information about what Debian considers to be Free Software, see http://www.debian.org/social_contract#guidelines");
-  section_descriptions["non-US"]=_("Programs stored outside the US due to export controls\n Packages in 'non-US' likely contain cryptography; a few implement patented algorithms. Because of this, they cannot be exported from the United States, and hence are stored on a server in the \"free world\".\n .\n Note: the Debian Project is currently merging cryptographic software into the US-based archives after consulting with legal experts about recent changes in export policies. Most packages which were formerly found in this section, therefore, are now in 'main'.");
-  section_descriptions["non-free"]=_("Programs which are not free software\n Packages in the 'non-free' section are not part of Debian.\n .\n These packages fail to meet one or more of the requirements of the Debian Free Software Guidelines (see below). You should read the license of programs in this section to be sure that you are allowed to use them in the way you intend.\n .\n For more information about what Debian considers to be Free Software, see http://www.debian.org/social_contract#guidelines");
+  section_descriptions["alien"]=transcode(_("Packages converted from foreign formats (rpm, tgz, etc)\n Packages in the 'alien' section were created by the 'alien' program from a non-Debian package format such as RPM"));
+  section_descriptions["base"]=transcode(_("The Debian base system\n Packages in the 'base' section are part of the initial system installation."));
+  section_descriptions["comm"]=transcode(_("Programs for faxmodems and other communications devices\n Packages in the 'comm' section are used to control modems and other hardware communications devices. This includes software to control faxmodems (for instance, PPP for dial-up internet connections and programs originally written for that purpose, such as zmodem/kermit), as well as software to control cellular phones, interface with FidoNet, and run a BBS."));
+  section_descriptions["devel"]=transcode(_("Utilities and programs for software development\n Packages in the 'devel' section are used to write new software and work on existing software. Non-programmers who do not compile their own software probably do not need much software from this section.\n .\n It includes compilers, debugging tools, programmer's editors, source processing tools, and other things related to software development."));
+  section_descriptions["doc"]=transcode(_("Documentation and specialized programs for viewing documentation\n Packages in the 'doc' section document parts of the Debian system, or are viewers for documentation formats."));
+  section_descriptions["editors"]=transcode(_("Text editors and word processors\n Packages in the 'editors' section allow you to edit plain ASCII text. These are not necessarily word processors, although some word processors may be found in this section."));
+  section_descriptions["electronics"]=transcode(_("Programs for working with circuits and electronics\n Packages in the 'electronics' section include circuit design tools, simulators and assemblers for microcontrollers, and other related software."));
+  section_descriptions["embedded"]=transcode(_("Programs for embedded systems\n Packages in the 'embedded' section are meant to run on embedded devices. Embedded devices are specialized hardware devices with much less power than a typical desktop system: for instance, a PDA, a cell phone, or a Tivo."));
+  section_descriptions["gnome"]=transcode(_("The GNOME Desktop System\n GNOME is a collection of software which provides an easy-to-use desktop environment for Linux.  Packages in the 'gnome' section are part of the GNOME environment or closely integrated into it."));
+  section_descriptions["games"]=transcode(_("Games, toys, and fun programs\n Packages in the 'games' section are meant primarily for entertainment."));
+  section_descriptions["graphics"]=transcode(_("Utilities to create, view, and edit graphics files\n Packages in the 'graphics' section include viewers for image files, image processing and manipulation software, software to interact with graphics hardware (such as video cards, scanners, and digital cameras), and programming tools for handling graphics."));
+  section_descriptions["hamradio"]=transcode(_("Software for ham radio operators\n Packages in the 'hamradio' section are meant primarily for ham radio operators."));
+  section_descriptions["interpreters"]=transcode(_("Interpreters for interpreted languages\n Packages in the 'interpreters' section include interpreters for languages like Python, Perl, and Ruby, and libraries for these same languages."));
+  section_descriptions["kde"]=transcode(_("The KDE Desktop System\n KDE is a collection of software which provides an easy-to-use desktop environment for Linux.  Packages in the 'kde' section are part of the KDE environment or closely integrated into it."));
+  section_descriptions["libdevel"]=transcode(_("Development files for libraries\n Packages in the 'libdevel' section contain files required for building programs that use libraries in the 'libs' section.  You don't need packages from this section unless you want to compile software yourself."));
+  section_descriptions["libs"]=transcode(_("Collections of software routines\n Packages in the 'libs' section provide necessary functionality for other software on the computer. With very few exceptions, you should not need to explicitly install a package from this section; the package system will install them as required to fulfill dependencies."));
+  section_descriptions["perl"]=transcode(_("Perl interpreter and libraries\n Packages in the 'perl' section provide the Perl programming language and many third-party libraries for it. Unless you are a Perl programmer, you don't need to install packages from this section explicitly; the package system will install them if they are required."));
+  section_descriptions["python"]=transcode(_("Python interpreter and libraries\n Packages in the 'python' section provide the Python programming language and many third-party libraries for it. Unless you are a Python programmer, you don't need to install packages from this section explicitly; the package system will install them if they are required."));
+  section_descriptions["mail"]=transcode(_("Programs to write, send, and route email messages\n Packages in the 'mail' section include mail readers, mail transport daemons, mailing list software, and spam filters, as well as various other software related to electronic mail."));
+  section_descriptions["math"]=transcode(_("Numeric analysis and other mathematics-related software\n Packages in the 'math' section include calculators, languages for mathematical computation (similar to Mathematica), symbolic algebra packages, and programs to visualize mathematical objects."));
+  section_descriptions["misc"]=transcode(_("Miscellaneous software\n Packages in the 'misc' section have too unusual a function to be classified."));
+  section_descriptions["net"]=transcode(_("Programs to connect to and provide various services\n Packages in the 'net' section include clients and servers for many protocols, tools to manipulate and debug low-level network protocols, IM systems, and other network-related software."));
+  section_descriptions["news"]=transcode(_("Usenet clients and servers\n Packages in the 'news' section are related to the Usenet distributed news system.  They include news readers and news servers."));
+  section_descriptions["oldlibs"]=transcode(_("Obsolete libraries\n Packages in the 'oldlibs' section are obsolete and should not be used by new software.  They are provided for compatibility reasons, or because software distributed by Debian still requires them.\n .\n With very few exceptions, you should not need to explicitly install a package from this section; the package system will install them as required to fulfill dependencies."));
+  section_descriptions["otherosfs"]=transcode(_("Emulators and software to read foreign filesystems\n Packages in the 'otherosfs' section emulate hardware and operating systems and provide tools for transferring data between different operating systems and hardware platforms. (for instance, utilities to read DOS floppies, and utilities to communicate with Palm Pilots)\n .\n It is worth noting that CD burning software is included in THIS section."));
+  section_descriptions["science"]=transcode(_("Software for scientific work\n Packages in the 'science' section include tools for astronomy, biology, and chemistry, as well as other science-related software."));
+  section_descriptions["shells"]=transcode(_("Command shells and alternative console environments\n Packages in the 'shells' section include programs providing a command-line interface."));
+  section_descriptions["sound"]=transcode(_("Utilities to play and record sound\n Packages in the 'sound' section include sound players, recorders, and encoders for many formats, mixers and volume controls, MIDI sequencers and programs to generate musical notation, drivers for sound hardware, and sound processing software."));
+  section_descriptions["tex"]=transcode(_("The TeX typesetting system\n Packages in the 'tex' section are related to TeX, a system for producing high-quality typeset output.  They include TeX itself, TeX packages, editors designed for TeX, utilities to convert TeX and TeX output files to various formats, TeX fonts, and other software related to TeX."));
+  section_descriptions["text"]=transcode(_("Text processing utilities\n Packages in the 'text' section include text filters and processors, spelling checkers, dictionary programs, utilities to convert between character encodings and text file formats (eg, Unix and DOS), text formatters and pretty-printers, and other software which operates on plain text."));
+  section_descriptions["utils"]=transcode(_("Various system utilities\n Packages in the 'utils' section are utilities whose purpose is too unique to be classified."));
+  section_descriptions["web"]=transcode(_("Web browsers, servers, proxies, and other tools\n Packages in the 'web' section include Web browsers, Web servers and proxies, software to write CGI scripts or Web-based programs, pre-written Web-based programs, and other software related to the World Wide Web."));
+  section_descriptions["x11"]=transcode(_("The X window system and related software\n Packages in the 'x11' section include the core packages for the X window system, window managers, utility programs for X, and miscellaneous programs with an X GUI which were placed here because they didn't fit anywhere else."));
+
+  section_descriptions["contrib"]=transcode(_("Programs which depend on software not in Debian\n Packages in the 'contrib' section are not part of Debian.\n .\n These packages are Free Software, but they depend on software which is not part of Debian.  This may be because it is not Free Software, but is packaged in the non-free section of the archive, because Debian cannot distribute it at all, or (in rare cases) because no-one has packaged it yet.\n .\n For more information about what Debian considers to be Free Software, see http://www.debian.org/social_contract#guidelines"));
+  section_descriptions["main"]=transcode(_("The main Debian archive\n The Debian distribution consists of packages from the 'main' section. Every package in 'main' is Free Software.\n .\n For more information about what Debian considers to be Free Software, see http://www.debian.org/social_contract#guidelines"));
+  section_descriptions["non-US"]=transcode(_("Programs stored outside the US due to export controls\n Packages in 'non-US' likely contain cryptography; a few implement patented algorithms. Because of this, they cannot be exported from the United States, and hence are stored on a server in the \"free world\".\n .\n Note: the Debian Project is currently merging cryptographic software into the US-based archives after consulting with legal experts about recent changes in export policies. Most packages which were formerly found in this section, therefore, are now in 'main'."));
+  section_descriptions["non-free"]=transcode(_("Programs which are not free software\n Packages in the 'non-free' section are not part of Debian.\n .\n These packages fail to meet one or more of the requirements of the Debian Free Software Guidelines (see below). You should read the license of programs in this section to be sure that you are allowed to use them in the way you intend.\n .\n For more information about what Debian considers to be Free Software, see http://www.debian.org/social_contract#guidelines"));
 
-  section_descriptions["virtual"]=_("Virtual packages\n These packages do not exist; they are names other packages use to require or provide some functionality.");
+  section_descriptions["virtual"]=transcode(_("Virtual packages\n These packages do not exist; they are names other packages use to require or provide some functionality."));
 
   already_done=true;
 }
@@ -256,17 +258,17 @@
 
 	  if(section_descriptions.find(realtag)!=section_descriptions.end())
 	    {
-	      string desc=section_descriptions[realtag];
+	      wstring desc=section_descriptions[realtag];
 
-	      if(desc.find('\n')!=desc.npos)
-		newtree=new pkg_subtree(tag+" - "+string(desc, 0, desc.find('\n')),
+	      if(desc.find(L'\n')!=desc.npos)
+		newtree=new pkg_subtree(transcode(tag)+L" - "+wstring(desc, 0, desc.find('\n')),
 					desc,
 					get_desc_sig());
 	      else
-		newtree=new pkg_subtree(tag+desc);
+		newtree=new pkg_subtree(transcode(tag)+desc);
 	    }
 	  else
-	    newtree=new pkg_subtree(tag);
+	    newtree=new pkg_subtree(transcode(tag));
 
 	  sections[tag].first=chain->instantiate(get_sig(), get_desc_sig());
 	  sections[tag].second=newtree;
@@ -375,8 +377,8 @@
 
   if(!children[section].second)
     {
-      string desc=_(state_titles[section]);
-      string shortdesc=string(desc, 0, desc.find('\n'));
+      wstring desc=transcode(_(state_titles[section]));
+      wstring shortdesc(desc, 0, desc.find('\n'));
 
       pkg_subtree *newtree=new pkg_subtree_with_order(shortdesc, desc,
 						      get_desc_sig(), section);
@@ -448,8 +450,8 @@
       {
 	if(!children[group].second)
 	  {
-	    string desc=_(child_names[group]);
-	    string shortdesc=string(desc, 0, desc.find('\n'));
+	    wstring desc=transcode(_(child_names[group]));
+	    wstring shortdesc(desc, 0, desc.find('\n'));
 
 	    pkg_subtree *newtree=new pkg_subtree_with_order(shortdesc,
 							    desc,
@@ -468,8 +470,8 @@
       {
 	if(!recommended_child.second)
 	  {
-	    string desc=_("Packages which are recommended by other packages\n These packages are not strictly required, but they may be necessary to provide full functionality in some other programs that you are installing or upgrading.");
-	    string shortdesc=string(desc, 0, desc.find('\n'));
+	    const wstring desc=transcode(_("Packages which are recommended by other packages\n These packages are not strictly required, but they may be necessary to provide full functionality in some other programs that you are installing or upgrading."));
+	    const wstring shortdesc(desc, 0, desc.find('\n'));
 
 	    pkg_subtree *newtree=new pkg_subtree_with_order(shortdesc,
 							    desc,
@@ -488,8 +490,8 @@
       {
 	if(!suggested_child.second)
 	  {
-	    string desc=_("Packages which are suggested by other packages\n These packages are not required in order to make your system function properly, but they may provide enhanced functionality for some programs that you are currently installing.");
-	    string shortdesc=string(desc, 0, desc.find('\n'));
+	    const wstring desc=transcode(_("Packages which are suggested by other packages\n These packages are not required in order to make your system function properly, but they may provide enhanced functionality for some programs that you are currently installing."));
+	    const wstring shortdesc(desc, 0, desc.find('\n'));
 
 	    pkg_subtree *newtree=new pkg_subtree_with_order(shortdesc,
 							    desc,
@@ -570,7 +572,7 @@
 	string treename;
 	treename+=firstchar;
 
-	pkg_subtree *newtree=new pkg_subtree(treename);
+	pkg_subtree *newtree=new pkg_subtree(transcode(treename));
 	pkg_grouppolicy *newchild=chain->instantiate(get_sig(),
 						     get_desc_sig());
 	children[firstchar].first=newchild;
@@ -663,7 +665,7 @@
 	  default                        : order=6; break;
 	  };
 
-	pkg_subtree *newtree=new pkg_subtree_with_order(buf, order);
+	pkg_subtree *newtree=new pkg_subtree_with_order(transcode(buf), order);
 	pkg_grouppolicy *newchild=chain->instantiate(get_sig(),
 						     get_desc_sig());
 	children[priority].first=newchild;
@@ -761,7 +763,7 @@
       {
 	if(!uncategorized)
 	  {
-	    uncategorized=new pkg_subtree("UNCATEGORIZED");
+	    uncategorized=new pkg_subtree(transcode(_("UNCATEGORIZED")));
 	    uncategorized_policy=chain->instantiate(sig, desc_sig);
 	    root->add_child(uncategorized);
 	  }
@@ -774,7 +776,7 @@
   {
     nodedata *data=(nodedata *) parent_data;
 
-    pkg_subtree *newtree=new pkg_subtree(group->description);
+    pkg_subtree *newtree=new pkg_subtree(transcode(group->description));
     pkg_grouppolicy *newpolicy=chain->instantiate(sig, desc_sig);
 
     nodedata *rval=new nodedata(newpolicy, newtree);
@@ -838,8 +840,11 @@
 
 class pkg_grouppolicy_task:public pkg_grouppolicy
 {
+  /** The subtrees are indexed by Task. */
   typedef hash_map<string, pkg_subtree *> subtree_map;
-  typedef vector<pair<string, string> > desclist;
+
+  /** A list of [task,description] pairs. */
+  typedef vector<pair<string, wstring> > desclist;
 
   // HACK: put all our stuff under this.
   pkg_subtree *tasks_subtree;
@@ -877,13 +882,13 @@
   if(already_done)
     return;
 
-  task_section_descriptions.push_back(pair<string,string>("user", dgettext("tasksel", "End-user")));
-  task_section_descriptions.push_back(pair<string,string>("server", dgettext("tasksel", "Servers")));
-  task_section_descriptions.push_back(pair<string,string>("devel", dgettext("tasksel", "Development")));
-  task_section_descriptions.push_back(pair<string,string>("l10n", dgettext("tasksel", "Localization")));
-  task_section_descriptions.push_back(pair<string,string>("hware", dgettext("tasksel", "Hardware Support")));
-  task_section_descriptions.push_back(pair<string,string>("misc", dgettext("tasksel", "Miscellaneous")));
-  task_section_descriptions.push_back(pair<string,string>("unknown", dgettext("tasksel", "Unrecognized tasks")));
+  task_section_descriptions.push_back(pair<string,wstring>("user", transcode(dgettext("tasksel", "End-user"))));
+  task_section_descriptions.push_back(pair<string,wstring>("server", transcode(dgettext("tasksel", "Servers"))));
+  task_section_descriptions.push_back(pair<string,wstring>("devel", transcode(dgettext("tasksel", "Development"))));
+  task_section_descriptions.push_back(pair<string,wstring>("l10n", transcode(dgettext("tasksel", "Localization"))));
+  task_section_descriptions.push_back(pair<string,wstring>("hware", transcode(dgettext("tasksel", "Hardware Support"))));
+  task_section_descriptions.push_back(pair<string,wstring>("misc", transcode(dgettext("tasksel", "Miscellaneous"))));
+  task_section_descriptions.push_back(pair<string,wstring>("unknown", transcode(dgettext("tasksel", "Unrecognized tasks"))));
 }
 
 /** Uses the fact that 0<=Relevance<=10 to encode Relevance as a character. */
@@ -891,7 +896,7 @@
 {
   char relevance[2];
 public:
-  task_subtree(std::string _name, std::string _description,
+  task_subtree(const std::wstring &_name, const std::wstring &_description,
 	       desc_signal *_info_signal,
 	       int _relevance)
     :pkg_subtree(_name, _description, _info_signal)
@@ -934,14 +939,15 @@
 
 	  if(!tasks_subtree)
 	    {
-	      tasks_subtree=new pkg_subtree(_("Tasks"), _("\n Tasks are groups of packages which provide an easy way to select a predefined set of packages for a particular purpose."), get_desc_sig());
+	      tasks_subtree=new pkg_subtree(transcode(_("Tasks")),
+					    transcode(_("\n Tasks are groups of packages which provide an easy way to select a predefined set of packages for a particular purpose.")), get_desc_sig());
 	      root->add_child(tasks_subtree);
 	    }
 
 	  subtree_map::iterator sectionfound=section_children.find(section);
 	  if(sectionfound==section_children.end())
 	    {
-	      string sectiondesc=section;
+	      wstring sectiondesc=transcode(section, "ASCII");
 
 	      for(desclist::iterator j=task_section_descriptions.begin();
 		  j!=task_section_descriptions.end();
@@ -960,12 +966,13 @@
 	    sectiontree=sectionfound->second;
 
 	  if(taskfound!=task_list->end())
-	    newtree=new task_subtree(taskfound->second.shortdesc,
-				     taskfound->second.longdesc,
+	    newtree=new task_subtree(transcode(taskfound->second.shortdesc),
+				     transcode(taskfound->second.longdesc),
 				     get_desc_sig(),
 				     taskfound->second.relevance);
 	  else
-	    newtree=new task_subtree(*i, "", get_desc_sig(), 5);
+	    newtree=new task_subtree(transcode(*i), L"",
+				     get_desc_sig(), 5);
 
 	  task_children[*i]=newtree;
 

Modified: branches/aptitude-0.3/aptitude/src/pkg_grouppolicy.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/pkg_grouppolicy.h	(original)
+++ branches/aptitude-0.3/aptitude/src/pkg_grouppolicy.h	Sat Jul  2 16:03:44 2005
@@ -1,6 +1,6 @@
 // pkg_grouppolicy.h       -*-c++-*-
 //
-//  Copyright 1999,2000,2001 Daniel Burrows
+//  Copyright 1999-2002, 2005 Daniel Burrows
 //
 //  This program is free software; you can redistribute it and/or modify
 //  it under the terms of the GNU General Public License as published by
@@ -56,7 +56,7 @@
 		      const pkgCache::VerIterator &> pkg_signal;
 
 // Used to set the visible description for other items.
-typedef sigc::signal1<void, std::string> desc_signal;
+typedef sigc::signal1<void, std::wstring> desc_signal;
 
 class pkg_subtree;