This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 113945 - Incorrect encoding of JAD
Summary: Incorrect encoding of JAD
Status: VERIFIED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: Build System (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Adam Sotona
URL:
Keywords:
: 114068 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-08-28 07:21 UTC by alexhy
Modified: 2007-11-22 18:24 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alexhy 2007-08-28 07:21:50 UTC
Midlet属性里如果有中文的话,netbean打包出来的jad里是乱码,文件编码是gb,正确的话应该用UTF-8。
Comment 1 Lukas Hasik 2007-08-28 07:37:27 UTC
Thank you for the report. I'm really sorry that I have to close it as WORKSFORME/INCOMPLETE. THere is only one reason -
nobody here speaks chinese/japanese. Please provide a description of your problem in English.

Reassiging to build system, jad and MIDlet has nothing to do with "cdc pack"
Thank you for understanding.
Comment 2 Lukas Hasik 2007-08-28 07:39:02 UTC
please use English in comments
Comment 3 Lukas Hasik 2007-08-28 07:43:14 UTC
ok, babelfish helped me.

Summary:  	Packs in output jad Chinese additive device
Original comment: In the Midlet attribute if has Chinese, netbean packs in
jad is the additive device, the document code is gb, the correct 
speech should use UTF-8.

Adame, could you look at it. I'm not sure what encoding we are using and when... Do we use system.locale or UTF?
Comment 4 alexhy 2007-08-29 02:11:59 UTC
Jad file not in correct encoding while use chinese attribute value

In the Midlet attribute value use Chinese, after netbean packed the jar, the jad file is not in correct encoding, now 
the jad file's encoding is gb,the correct encoding should be UTF-8.
Comment 5 Adam Sotona 2007-08-29 10:38:53 UTC
*** Issue 114068 has been marked as a duplicate of this issue. ***
Comment 6 Adam Sotona 2007-08-29 10:40:38 UTC
Yes, first we generate the Jad correctly and then we update it with incorrect encoding.

Fixed.
Comment 7 alexhy 2007-08-30 06:57:51 UTC
Yes, first we generate the Jad correctly and then we update it with incorrect encoding.

Fixed.
====================================================
Not good,best solution is netbean to do this auto encoding not user do it by self.
Comment 8 Adam Sotona 2007-08-30 07:46:12 UTC
I told it is fixed.
Jad is now always UTF-8.
Why do you reopen without verification.
Comment 9 Lukas Hasik 2007-08-30 11:40:20 UTC
Alexhy, the fix is visible in latest 6.0 builds

If you wanna fix it in 5.5.1 you will have to copy following ant targets to build.xml in your project. You will see the
build.xml in files view.

---copy it to build.xml---

 <target name="override-jad" if="override.jarurl.trigger">
<property name="deployment.jarurl" value="${{dist.jar}}"/>
<nb-jad jadfile="${{dist.dir}}/${{dist.jad}}" jarfile="${{dist.dir}}/${{dist.jar}}" url="${{deployment.jarurl}}"
sign="${{sign.enabled}}" keystore="${{sign.keystore}}" keystorepassword="${{sign.keystore.password}}"
alias="${{sign.alias}}" aliaspassword="${{sign.alias.password}}" encoding="UTF-8"/>
</target> 

 <target name="update-jad" if="cldc-platform.trigger">
<nb-jad jadfile="${{dist.dir}}/${{dist.jad}}" jarfile="${{dist.dir}}/${{dist.jar}}" url="${{dist.jar}}"
sign="${{sign.enabled}}" keystore="${{sign.keystore}}" keystorepassword="${{sign.keystore.password}}"
alias="${{sign.alias}}" aliaspassword="${{sign.alias.password}}" encoding="UTF-8"/>
</target> 

---copy it to build.xml---
Comment 10 alexhy 2007-08-30 12:20:59 UTC
Alexhy, the fix is visible in latest 6.0 builds

If you wanna fix it in 5.5.1 you will have to copy following ant targets to build.xml in your project. You will see the
build.xml in files view.

---copy it to build.xml---

 <target name="override-jad" if="override.jarurl.trigger">
<property name="deployment.jarurl" value="${{dist.jar}}"/>
<nb-jad jadfile="${{dist.dir}}/${{dist.jad}}" jarfile="${{dist.dir}}/${{dist.jar}}" url="${{deployment.jarurl}}"
sign="${{sign.enabled}}" keystore="${{sign.keystore}}" keystorepassword="${{sign.keystore.password}}"
alias="${{sign.alias}}" aliaspassword="${{sign.alias.password}}" encoding="UTF-8"/>
</target> 

 <target name="update-jad" if="cldc-platform.trigger">
<nb-jad jadfile="${{dist.dir}}/${{dist.jad}}" jarfile="${{dist.dir}}/${{dist.jar}}" url="${{dist.jar}}"
sign="${{sign.enabled}}" keystore="${{sign.keystore}}" keystorepassword="${{sign.keystore.password}}"
alias="${{sign.alias}}" aliaspassword="${{sign.alias.password}}" encoding="UTF-8"/>
</target> 

---copy it to build.xml---
=====================================================
I have copy it to build.xml and rebuild project,but nothing changed,the jad is still not UTF-8.
Comment 11 Adam Sotona 2007-08-31 08:52:11 UTC
Guys, please.
First - this is fixed in 6.0 beta1.
Second - it is possible to fix it manually in 5.5.1 but using the fragment of build script form 5.5.1. Project build
script has changed significantly from 5.5.1 to 6.0. Lukas, I see triggers there - these work in 6.0 only. Alexhy, copy
all targets where <nb-jad is used from bild-impl.xml into build.xml and set the encoding attribute to UTF-8.
Comment 12 alexhy 2007-09-03 04:27:47 UTC
Guys, please.
First - this is fixed in 6.0 beta1.
Second - it is possible to fix it manually in 5.5.1 but using the fragment of build script form 5.5.1. Project build
script has changed significantly from 5.5.1 to 6.0. Lukas, I see triggers there - these work in 6.0 only. Alexhy, copy
all targets where <nb-jad is used from bild-impl.xml into build.xml and set the encoding attribute to UTF-8.
==================================================
Thanks,I'm using 6.0M10 now,jad problem have solved.
Comment 13 alexhy 2007-09-10 08:24:24 UTC
I found the jad file encoding is always incorrect by Netbean 6.0M10!should be UTF-8 but now is iso8859-1. 
Comment 14 Adam Sotona 2007-09-10 08:38:46 UTC
Alexhy, 
please, M10 was out on July 2, I fixed it on August 29, so you would probably agree with me it is not possible to shift
the fix back in time.

I remind again "It is fixed in BETA 1".
Comment 15 alexhy 2007-09-10 11:03:21 UTC
Alexhy, 
please, M10 was out on July 2, I fixed it on August 29, so you would probably agree with me it is not possible to shift
the fix back in time.

I remind again "It is fixed in BETA 1".
=================================================
Thanks,wish new version release as soon as possible.
Comment 16 alexhy 2007-09-24 08:21:11 UTC
please, M10 was out on July 2, I fixed it on August 29, so you would probably agree with me it is not possible to shift
the fix back in time.

I remind again "It is fixed in BETA 1".
=============================================
I have install the newest 6.0 BETA 1,and open project made by 6.0M10,the JAD encoding problem is not fixed.
Comment 17 Lukas Hasik 2007-09-25 09:29:29 UTC
could you try Clean&Build? The JAD should be generated correctly.
It isn't true if you edited the build.xml and replaced the "override-jad" task.


I can confirm that there is encoding UTF-8 used fo writing JAD/manifest to HD.
Could you attach a sample project that demonstrate he incorrect behavior? Thank you.
Comment 18 Lukas Hasik 2007-11-22 18:24:48 UTC
v