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 141052 - I18N - sample project not use utf-8 encoding completely
Summary: I18N - sample project not use utf-8 encoding completely
Status: RESOLVED WONTFIX
Alias: None
Product: php
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: Sun All
: P4 blocker (vote)
Assignee: Tomas Mysik
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2008-07-21 19:07 UTC by Ken Frank
Modified: 2011-06-09 10:49 UTC (History)
1 user (show)

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 Ken Frank 2008-07-21 19:07:01 UTC
since utf-8 is default project encoding for netbeans and since
trend is more toward using utf-8 encoding in databases and web apps, etc,
it seems if php sample project should use utf-8 encoding completely,
it could help, and it means the project would work if someone
entered non ascii characters when creating a new entry.

besides changes that might be needed to php code, also sql script
would need changing to use utf-8 instead of latin encoding
as well as instructions on how to change the created dbase
to use utf8, since default mysql dbase uses swedish latin encoding.

we have many users who run in other locales than english one thus
thats why not marking this as rfe.

This is not about having the sample to be translated; we don't translate
the sample project code comments or other places.
Comment 1 Tomas Mysik 2008-07-22 08:51:40 UTC
Reassigning to the module owner - please evaluate. Thanks.
Comment 2 Ken Frank 2008-08-18 23:55:53 UTC
am trying to see more about this

1. have changed using mysql admin the allianec db to use utf-8 for dbase,
table and columns of the passenger

2. have changed using nb sql commands to set the character set for connection,
results and client to utf8

3. in php index.php code have added
$query = "SET NAMES 'utf8'";

$result = mysql_query($query);

but don't know how to print out the values to find out 


results

1. when add a new customer in the air alliance sample, using 
multibyte of the encoding in which the air alliance project is -
the mbyte shows ok in the air alliance windows


but in mysql phpadmin or using nb view data, the customer names do not show ok.


2. using nb sql commands, adding a new customer with mbyte in the name,
and changing other air alliance tables so that in effect a new reservation
is created, the mbyte shows ok in nb sql query, but does not in the air alliance
sample.


3. is there any nb activity itself going on in these 2 cases as to communication
about encoding ?

is the code I added correct and at correct place ?

i guess there would be other code to add about encoding for reading in from the dbase
vs writing to it or is the same code in index.php ok ?

is the code added about set NAMES correct syntax so that it really happens - this
is what have read in many articles to do.


4. this is not about translation of the sample at all, just that it would be good
that sample worked with non ascii (which also would involve changing the sql scripts
that creates the tables.


ken.frank@sun.com
Comment 3 Ken Frank 2008-08-22 23:38:23 UTC
more info - have added set NAMES 'utf8' to more places in code in various files near where
db connect and open calls are.

code also has already the meta charset tags in the various html code sections

as mentioned before, dbase itself was changed to use utf8 encoding vs existing
that uses latin 1 plus hardcodes the encoding of each table

---> can this sample be changed so that users can put in other characters than
ascii in it, if those characters are utf-8 ok; and since sample project itself
encoding is utf-8 (for samples, they are hardcoded to be utf-8 project encoding
by design), then it seems it should work.

But we can state that sample is not meant to have a different project encoding or characters
than utf8, since means user would need to change more code of it ?


for this change, code for us to change would be:
1. modifying the sql table creation script
2. creating dbase instructions to use utf8
3. adding set NAMES 'utf8' calls to various places.

since we do have many users in countries where english is not used and for something
like this app, ie someone's name as part of reservation, those characters of their
locale would more likely to be used.

ken.frank@sun.com
Comment 4 Ken Frank 2008-08-22 23:50:45 UTC
well, what was not mentioned in last comments was that in doing the steps
mentioned, things look ok now - can input or paste multibyte and it shows ok
in other parts of the app and also shows ok in nb db view data -- which is proving
round trip conversion of data and on re-reading of it.

ken.frank@sun.com
Comment 5 Petr Pisl 2008-09-25 14:52:29 UTC
No time to fix it in NetBeans 6.5. 
Comment 6 Filip Zamboj 2009-05-14 14:57:03 UTC
Reasigning back to tmysik 
Comment 7 Filip Zamboj 2010-09-15 12:36:16 UTC
batch reassigning
Comment 8 Tomas Mysik 2011-06-09 10:49:40 UTC
No plans to work on this, sorry.