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 154882 - I18N : generated PHP files from templates for web service are corrupted in some locales
Summary: I18N : generated PHP files from templates for web service are corrupted in so...
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Ayub Khan
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2008-12-08 06:49 UTC by Masaki Katakai
Modified: 2009-04-10 03:46 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch (1.33 KB, patch)
2009-04-06 00:01 UTC, Masaki Katakai
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Masaki Katakai 2008-12-08 06:49:04 UTC
(According to bug 136961, it looks the correct category of PHP teamplate is ruby/gsf.
Please change component if I'm wrong)

When I drag&drop a web service e.g. twitter into editor for PHP, the following
file is corrupted in some locales e.g. Shift-JIS environment of Japanese Windows.

   org_netbeans_saas/RestConnection.php 

It seems that these templates contain UTF-8 character,“ and ”. It causes the corruption.

websvc.saas.codegen.php/src/org/netbeans/modules/websvc/saas/codegen/php/resources/RestConnection.template
websvc.saas.codegen.php/src/org/netbeans/modules/websvc/saas/codegen/php/resources/SignedUrlAuthenticator.template

RestConnection.php is generated as below,

    require_once 'PEAR.php';    
    // get this with “pear install HTTP_Request??    require_once "HTTP/Request.php";
    include_once "RestResponse.php";

But it should be

    require_once 'PEAR.php';
    // get this with “pear install HTTP_Request”
    require_once "HTTP/Request.php";
    include_once "RestResponse.php";

The problem is, //... line and "require_once "HTTP/Request.php";" line are combined.
So "HTTP/Request.php" can not be found and the program will fail to run.

I think the easy fix is to remove these UTF-8 characters and use " instead in templates.

The similar issue has been filed as bug 141236 but it has been marked as resolved.
I think this is the root cause.
Comment 1 Torbjorn Norbye 2008-12-10 03:29:31 UTC
PHP templates issues should generally be filed against the PHP category, not GSF. Issue 136961 was special because it had to do with the underlying data 
object implementation for instantiating templates. But changing the contents etc. of templates should be done in the PHP modules.
Comment 2 Petr Pisl 2008-12-15 09:53:14 UTC
These templates come from webservices module. Reassigning. 
Comment 3 Ayub Khan 2009-04-03 16:13:22 UTC
Evaluation:

I would like to waive this issue for 6.7, since
- There is no resource to work on this issue.
Comment 4 Masaki Katakai 2009-04-06 00:01:19 UTC
Created attachment 79493 [details]
patch
Comment 5 Masaki Katakai 2009-04-06 00:05:28 UTC
I think the fix is very simple. I attached the patch. Let's fix it for 6.7,
actually it's not working these codes in Japanese Windows platform.

Could you check the patch and integrate?
Comment 6 Ayub Khan 2009-04-07 23:50:45 UTC
Thanks Masaki for the patch. Its a mystery how the file got corrupted. Hopefully this 
time the fix works.

Fixed for NB6.7
Comment 7 Quality Engineering 2009-04-09 19:31:56 UTC
Integrated into 'main-golden', will be available in build *200904091401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/7ed82485ae35
User: Ayub Khan <ayubskhan@netbeans.org>
Log: Fix issue#154882 - I18N : generated PHP files from templates for web service are corrupted in some locales
Comment 8 Masaki Katakai 2009-04-10 03:46:09 UTC
Thank you very much Ayub!

I've verified the fix on 200904091401 build. Great!