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 144905 - I18N - make wish tutorial able to use and diaplay non ascii
Summary: I18N - make wish tutorial able to use and diaplay non ascii
Status: RESOLVED FIXED
Alias: None
Product: usersguide
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jeffrey Rubinoff
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2008-08-22 23:47 UTC by Ken Frank
Modified: 2008-11-20 21:02 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ken Frank 2008-08-22 23:47:31 UTC
Many users are from locales where non ascii is used, and in something like
wish app, with a persons name and something like a wish, its more likely
those characters would be used. 
Thus could the tutorial have some few additions and changes so that users
can use any valid utf8 character

I experimented with tutorial and found when I made these changes or additions, things
seem to look ok with non ascii

assumptions for my experiments:
1.am running in ja locale, but the project uses default utf8 project encoding

2. characters used in browser for name and wish need to be utf8 ok, solaris/linux has
utf8 locales to run in but windows does not, but maybe the characters input will
be ok since in nb projects on windows, using utf8 project encoding the characters
show ok


What I did


a. create the dbase to use utf8 dbase encoding since default for mysql is latin encoding

b. added meta charset tags to html sections with utf-8 as the value

c. added mysql_query("SET NANES 'utf8'");
to various php files of the tutorial, usually where dbase connection
has just happened - it seemed like it was needed more than once
so just did it in many files
(this sets connection and result and client character sets of mysql


d. now the non ascii entered in the app looks ok in the app and in nb db viewer.

===> Can you consider this for tutorial ?
Comment 1 Jeffrey Rubinoff 2008-09-24 15:48:01 UTC
Ken,
Can you tell me how you did (a)? I am not exactly a MySQL guru.
Comment 2 Ken Frank 2008-09-24 16:13:03 UTC
Jeff,
I used phpmyadmin and/or command line to query the different character set values of mysql - it has a lot of them
and its sometimes not clear about what each does (see mysql manual chapter 9 on this topic).  I took a brute
force approach for this experiment and changed all values except the server value - this command can be used
to show the values
show variables LIKE 'character_set%'

then changed the values that were not utf-8 to it

BTW, if there is a table created with specific character set noted, then it too needs to be changed; I can't recall if
this demo sql scripts did that or not.

ken.frank@sun.com

BTW #2, my typo below is step c, should be SET NAMES, not NANES.
Comment 3 Jeffrey Rubinoff 2008-11-18 16:45:49 UTC
Fixed according to Dean Ellis' advice. Character sets are set at the table/column level instead at the database level,
since table/column settings override database settings. Fixed only on staging server version. 
Comment 4 Jeffrey Rubinoff 2008-11-20 21:02:41 UTC
to be specific, I added ken's steps b and c: wherever a database connection is created, I added mysql_query("SET
NAMES");, and I added the meta charset tags to html sections, at least the ones where character data will be displayed.
Instead of setting the database to use utf-8, I added the following MySQL to wherever character type data table columns
were created. For example, note the "name" and "password" columns below:
CREATE TABLE wishers(
          id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
          name CHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL UNIQUE,
          password CHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
)