Index: /trunk/include/iprt/env.h
===================================================================
--- /trunk/include/iprt/env.h	(revision 41722)
+++ /trunk/include/iprt/env.h	(revision 41723)
@@ -55,9 +55,13 @@
  * environment array.
  *
- * @returns IPRT status code. Typical error is VERR_NO_MEMORY. Another
- * possible return code is VWRN_NO_TRANSLATION if EnvToClone is RTENV_DEFAULT
- * and there was no translation available for one environment variable. In
- * that case, the resulting environment will contain fewer elements than the
- * original environment.
+ * @returns IPRT status code.
+ * @retval  VWRN_ENV_NOT_FULLY_TRANSLATED may be returned when passing
+ *          RTENV_DEFAULT and one or more of the environment variables have
+ *          codeset incompatibilities.  The problematic variables will be
+ *          ignored and not included in the clone, thus the clone will have
+ *          fewer variables.
+ * @retval  VERR_NO_MEMORY
+ * @retval  VERR_NO_STR_MEMORY
+ * @retval  VERR_INVALID_HANDLE
  *
  * @param   pEnv        Where to store the handle of the new environment block.
Index: /trunk/include/iprt/err.h
===================================================================
--- /trunk/include/iprt/err.h	(revision 41722)
+++ /trunk/include/iprt/err.h	(revision 41723)
@@ -1506,4 +1506,7 @@
 /** The specified environment variable was not found. (RTEnvUnsetEx) */
 #define VINF_ENV_VAR_NOT_FOUND                  (750)
+/** Unable to translate all the variables in the default environment due to
+ * codeset issues (LANG / LC_ALL / LC_CTYPE). */
+#define VWRN_ENV_NOT_FULLY_TRANSLATED           (751)
 /** @} */
 
Index: /trunk/src/VBox/Runtime/generic/env-generic.cpp
===================================================================
--- /trunk/src/VBox/Runtime/generic/env-generic.cpp	(revision 41722)
+++ /trunk/src/VBox/Runtime/generic/env-generic.cpp	(revision 41723)
@@ -240,15 +240,13 @@
         {
             /* ASSUMES the default environment is in the current codepage. */
-            bool fNoTranslation = false;
-            size_t iDst = 0;
+            size_t  iDst = 0;
             for (size_t iSrc = 0; iSrc < cVars; iSrc++)
             {
                 int rc2 = RTStrCurrentCPToUtf8(&pIntEnv->papszEnv[iDst], papszEnv[iSrc]);
-                if (rc2 == VERR_NO_TRANSLATION)
-                {
-                    fNoTranslation = true;
-                    continue;
-                }
-                if (RT_FAILURE(rc2))
+                if (RT_SUCCESS(rc2))
+                    iDst++;
+                else if (rc2 == VERR_NO_TRANSLATION)
+                    rc = VWRN_ENV_NOT_FULLY_TRANSLATED;
+                else
                 {
                     pIntEnv->cVars = iDst;
@@ -256,9 +254,6 @@
                     return rc2;
                 }
-                iDst++;
             }
             pIntEnv->cVars = iDst;
-            if (fNoTranslation)
-                rc = VWRN_NO_TRANSLATION;
         }
         else
