https://issues.apache.org/bugzilla/show_bug.cgi?id=45530

           Summary: ANT incorrectly copies env.variables with non-latin text
           Product: Ant
           Version: 1.7.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Core tasks
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


I have Russian WinXP with 2 user accounts: one has Russian name (i.e. contains
cyrillic symbols), another - English; say, "Тимофей" & "Timofey".
Attempt to run Visual Studio 7.1 or 8.0 (devenv.exe, cl.exe or link.exe) via
"exec" task fails under Russian user account because "%USERNAME%" contains some
garbage (incorrectly encoded cyrillic text), and thus %USERPROFILE%, %APPDATA%
point to not existent directory. 

This happens in both cases 
a) when parent process environment is inherited by exec's 
b) when exec creates new environment and %USERNAME% is explicitely copied to
new env.
This results in premanent failure to run my ant task under cyrillic user
account. But forks fine for latin user account. 

sample below demonstrates the case of inherited user environment:
    <target name="build-target" if="target.release.type">
        <mkdir dir="${build.dir}"/>

        <exec executable="cmd" dir="${bsp.root}" 
            newenvironment="false" searchpath="true" failonerror="true">
            <arg value="/c"/>
            <arg value="set"/>
        </exec>
    </target>

OR 

next sample demonstrates creation of new environment:
    <target name="build-target" if="target.release.type">
        <mkdir dir="${build.dir}"/>
        <exec executable="cmd" dir="${bsp.root}" 
            newenvironment="true" searchpath="true" failonerror="true">
            <env key="SystemDrive" value="${env.SystemDrive}"/>
            <env key="SystemRoot" value="${env.SystemRoot}"/>
            <env key="ALLUSERSPROFILE" value="${env.ALLUSERSPROFILE}"/>
            <env key="USERNAME" value="${env.USERNAME}"/>
            <env key="USERPROFILE" value="${env.USERPROFILE}"/>
            <env key="USERDOMAIN" value="${env.USERDOMAIN}"/>
            <env key="APPDATA" value="${env.APPDATA}"/>
            <arg value="/c"/>
            <arg value="set"/>
        </exec>
    </target>


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to