Hi All,

Thanks for all your inputs. We are half-way through.
We are using “–Dfile.encoding=UTF8” jvm args and now we are able to pass 
multi-byte strings from ANT to Java and even from the cmd to java also. This 
works when we set the system to a particular region and send the multi-byte 
characters FROM THAT PARTICULAR region only. That means if the system is set to 
Korean region then we can pass the '뒷다리' Korean string from ANT to java.

But in our case we have string which has the characters from different regions. 
That's why when we set the system to Korean region and pass 'hmỘnяỘỆ' then only 
the 'я' characters is getting passed properly. Other strings are coming as 
'?'(i.e 'hm?nя??')

Thanks,
Shashidhar Kotta.

-----Original Message-----
From: Shashidhar Kotta 
Sent: Thursday, December 11, 2008 3:58 PM
To: Ant Users List
Subject: RE: Passing multi-byte strings from ANT using <sysproperty> task

Hi,

I have tried with your ANT code but it is displaying ?m?n??? only.

Here is the simple java code which I am using.

                OutputStreamWriter bos = new OutputStreamWriter(new 
FileOutputStream("D://testoutput.txt"),"UTF-8");
                String username = System.getProperty("com.param1").trim();      
        
                bos.write(username);
                bos.close();

and here is the output from "testoutput.txt" file  -?m?nя??


Thanks,
Shashidhar Kotta.

-----Original Message-----
From: Greg Roodt [mailto:gro...@gmail.com] 
Sent: Thursday, December 11, 2008 3:42 PM
To: Ant Users List
Subject: Re: Passing multi-byte strings from ANT using <sysproperty> task

Ok, could you send me a simplified version of your Java code that is writing
the data to a file?
Does this work correctly for you?

<?xml version="1.0" encoding="UTF-8"?>
<project name="encoding-test" basedir="." default="echo">
<property name="com.param1" value="ђmỘnяỘỆ" />
 <target name="echo">
<echo message="${com.param1}" />
</target>
</project>





On Thu, Dec 11, 2008 at 9:49 AM, Shashidhar Kotta <shashidhar.ko...@ness.com
> wrote:

>
> Hi,
>
> You mean Unicode escapes sequences like '\u0012'?
>
> We have tried by passing the Unicode escape sequence like
> > "<sysproperty key="com.param1" value="\u0012" />"
>
> But when we call System.getProperty("com.param1") it is just giving us the
> same escapes sequences like '\u0012'.
>
> Surprisingly if we set this inside the java program(like the code below)
> then it is printing proper multi-byte character:
>
>                System.setProperty("com.param1", "\u0012");
>                System.out.println(System.getProperty("com.param1"));
>
> Thanks,
> Shashidhar Kotta.
>
> -----Original Message-----
> From: Greg Roodt [mailto:gro...@gmail.com]
> Sent: Thursday, December 11, 2008 2:03 PM
> To: Ant Users List
> Subject: Re: Passing multi-byte strings from ANT using <sysproperty> task
>
> This is a guess, but try using the Unicode escape sequences for your
> sysproperty.
>
>
>
> On Thu, Dec 11, 2008 at 7:12 AM, Shashidhar Kotta <
> shashidhar.ko...@ness.com
> > wrote:
>
> >
> > Hi All,
> >
> >
> >
> > In our project we have requirement to pass multi-byte strings from ANT to
> > java program. We are passing multi-byte strings using the <sysproperty>
> ANT
> > task. In the java program we are retrieving it using the
> > System.getProperty() method and saving that value to a text file which is
> in
> > UTF-8 format. But the proper multi-byte string is not getting saved into
> the
> > file. Could someone help me in resolving this issue?
> >
> >
> >
> > In the ANT file we are passing the multi-byte string like this:
> > "<sysproperty key="com.param1" value="ђmỘnяỘỆ" />"
> >
> > In the java program we are retrieving the string like
> > "System.getProperty("com.param1")".
> >
> >
> >
> > We are working on Windows environment with language pack installed and
> > using the Eclipse which has "text file encoding" property set to UTF-8.
> > Could someone help me in resolving this issue?
> >
> > Thanks in Advance…
> >
> >
> >
> >
> >
> > Thanks,
> >
> > Shashidhar Kotta.
> >
> >
> >
> >
> > Disclaimer
> >
> > The information contained in this communication is intended solely for
> the
> > use of the individual or entity to whom it is addressed and others
> > authorized to receive it.   It may contain confidential or legally
> > privileged information.   If you are not the intended recipient you are
> > hereby notified that any disclosure, copying, distribution or taking any
> > action in reliance on the contents of this information is strictly
> > prohibited and may be unlawful. If you have received this communication
> in
> > error, please notify us immediately by forwarding this email to
> > mailad...@ness.com and then delete it from your system. Ness
> technologies
> > is neither liable for the proper and complete transmission of the
> > information contained in this communication nor for any delay in its
> > receipt.
> >
>
> Disclaimer
>
> The information contained in this communication is intended solely for the
> use of the individual or entity to whom it is addressed and others
> authorized to receive it.   It may contain confidential or legally
> privileged information.   If you are not the intended recipient you are
> hereby notified that any disclosure, copying, distribution or taking any
> action in reliance on the contents of this information is strictly
> prohibited and may be unlawful. If you have received this communication in
> error, please notify us immediately by forwarding this email to
> mailad...@ness.com and then delete it from your system. Ness technologies
> is neither liable for the proper and complete transmission of the
> information contained in this communication nor for any delay in its
> receipt.
>

Disclaimer

The information contained in this communication is intended solely for the use 
of the individual or entity to whom it is addressed and others authorized to 
receive it.   It may contain confidential or legally privileged information.   
If you are not the intended recipient you are hereby notified that any 
disclosure, copying, distribution or taking any action in reliance on the 
contents of this information is strictly prohibited and may be unlawful. If you 
have received this communication in error, please notify us immediately by 
forwarding this email to mailad...@ness.com and then delete it from your 
system. Ness technologies is neither liable for the proper and complete 
transmission of the information contained in this communication nor for any 
delay in its receipt.

Reply via email to