Index: /trunk/Config.kmk
===================================================================
--- /trunk/Config.kmk	(revision 57648)
+++ /trunk/Config.kmk	(revision 57649)
@@ -552,5 +552,5 @@
 endif
 # Whether to generate a database of USB vendor IDs and device IDs into VBoxSVC.
-#VBOX_WITH_MAIN_USB_ID_DATABASE = 1
+VBOX_WITH_MAIN_USB_ID_DATABASE = 1
 # The recompiler.
 VBOX_WITH_REM = 1
Index: /trunk/src/VBox/Main/include/USBIdDatabase.h
===================================================================
--- /trunk/src/VBox/Main/include/USBIdDatabase.h	(revision 57648)
+++ /trunk/src/VBox/Main/include/USBIdDatabase.h	(revision 57649)
@@ -71,7 +71,7 @@
 protected:
     static Product productArray[];
-    static const size_t products_size;
+    static const size_t cProducts;
     static Vendor vendorArray[];
-    static const size_t vendors_size;
+    static const size_t cVendors;
 
 public:
@@ -79,5 +79,5 @@
     {
         Product lookFor = { USBKEY(vendorId, productId) };
-        Product* it = std::lower_bound(productArray, productArray + products_size, lookFor, ProductLess());
+        Product* it = std::lower_bound(productArray, productArray + cProducts, lookFor, ProductLess());
         return lookFor.key == it->key ? it->product : NULL;
     }
@@ -86,5 +86,5 @@
     {
         Vendor lookFor = { vendorID };
-        Vendor* it = std::lower_bound(vendorArray, vendorArray + vendors_size, lookFor, VendorLess());
+        Vendor* it = std::lower_bound(vendorArray, vendorArray + cVendors, lookFor, VendorLess());
         return lookFor.vendorID == it->vendorID ? it->vendor : NULL;
     }
Index: /trunk/src/VBox/Main/src-server/USBIdDatabaseGenerator.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/USBIdDatabaseGenerator.cpp	(revision 57648)
+++ /trunk/src/VBox/Main/src-server/USBIdDatabaseGenerator.cpp	(revision 57649)
@@ -19,4 +19,6 @@
 #include <string>
 
+#include <iprt/initterm.h>
+#include <iprt/message.h>
 #include <iprt/string.h>
 #include <iprt/stream.h>
@@ -51,5 +53,5 @@
     "};\n"
     "\n"
-    "const size_t AliasDictionary::products_size = sizeof(AliasDictionary::productArray) / sizeof(Product);\n";
+    "const size_t AliasDictionary::cProducts = sizeof(AliasDictionary::productArray) / sizeof(Product);\n";
 
 const char *vendor_header =
@@ -59,5 +61,5 @@
     "};\n"
     "\n"
-    "const size_t AliasDictionary::vendors_size = sizeof(AliasDictionary::vendorArray) / sizeof(Vendor);\n";
+    "const size_t AliasDictionary::cVendors = sizeof(AliasDictionary::vendorArray) / sizeof(Vendor);\n";
 
 const char *start_block = "# Vendors, devices and interfaces. Please keep sorted.";
@@ -110,10 +112,27 @@
 {
     string res = src;
-    for (size_t i = 0; i < res.length(); i++)
+    for (size_t i = 0; i < res.length(); ++i)
     {
         switch (res[i])
         {
         case '"':
-        case '\\': res.insert(i++, "\\");
+        case '\\': res.insert(i++, "\\"); break;
+        default:
+        {
+            if ((unsigned char)res[i] >= 127)
+            {
+                size_t start = i;
+                string temp = "\" \"";
+                char buffer[8] = { 0 };
+                do
+                {
+                    RTStrPrintf(buffer, sizeof(buffer), "\\x%x", (unsigned char)res[i]);
+                    temp.append(buffer);
+                } while ((unsigned char)res[++i] & 0x80);
+                temp.append("\" \"");
+                res.replace(start, i - start, temp);
+                i += temp.length();
+            }
+        }
         }
     }
@@ -272,4 +291,8 @@
 int main(int argc, char* argv[])
 {
+    int rc = RTR3InitExe(argc, &argv, 0);
+    if (RT_FAILURE(rc))
+        return RTMsgInitFailure(rc);
+
     if (argc < 4)
     {
@@ -285,5 +308,5 @@
 
     char* outName = NULL;
-    int rc = 0;
+    rc = 0;
     for (int i = 1; i < argc; i++)
     {
