• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

linux+mysql+coldfusion can support chinese application?

New Here ,
Jul 13, 2006 Jul 13, 2006

Copy link to clipboard

Copied

any one have idea on this?
linux (redhat enterprise)+mysql 5+coldfusion MX(utf-8) can support chinese application?
TOPICS
Advanced techniques

Views

991

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 13, 2006 Jul 13, 2006

Copy link to clipboard

Copied

chinaeye wrote:
> But when we moved to redhat linux +mysql, the chinese in the database
> displayed as ?????. when we insert into database, the
> chinese inserted like ????? as well...

garbaged encoding. new db? if so what version of mysql? what driver are you
using to talk to mysql? it can't be ODBC? if it's JDBC, do you have teh
connection string setup correctly? it should be:

"using useUnicode=true&characterEncoding=utf8"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2006 Jul 13, 2006

Copy link to clipboard

Copied

Dear all,
Now I can insert Chinese into database through coldfusion page, but those chinese display in the Web page site like '????????????',
Any one can help?

Great Thanks, refer to:
adsbus.com/test.cfm

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2006 Jul 13, 2006

Copy link to clipboard

Copied

thanks PaulH,

using useUnicode=true&characterEncoding=utf8

Yes, we apply it to our connection string,
it is mysql 5, but now, the web page display those chinese as ????

adsbus.com/test.cfm

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 13, 2006 Jul 13, 2006

Copy link to clipboard

Copied

post the code that inserts/displays the data.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2006 Jul 13, 2006

Copy link to clipboard

Copied

---------------- this is insert page, no problem, can insert into database-----------------

<cfprocessingdirective pageEncoding="utf-8">
<cfset setEncoding("FORM", "utf-8")>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<html>
<head>
<title>Untitled</title>
</head>

<body>
<CFPARAM NAME="URLadd" DEFAULT="">
<cfset URLadd='www.'&#form.searchkey1#>
<cfquery name="createhtml" datasource="adsbus">
select *
from abus_html
where (URL_Link ='#form.searchkey1#') or (URL_Link='#URLadd#')
</cfquery>

<!--- <cfif #createhtml.recordcount# eq 0> --->
<cfquery name="insertName" datasource="adsbus">
insert into abus_html (Domain_Name,URL_Link,IP,Date_Add,Comments)
values (N'#trim(form.searchkey)#',
N'#trim(form.searchkey1)#',
'#cgi.remote_addr#',
#now()#,
N'#trim(form.comments)#'
)
</cfquery>
<cfinclude template="static_htmlbus.cfm">
<!--- </cfif> --->

<cfquery name="getsign" datasource="adsbus">
select *
from abus_b
where (URL_Link ='#form.searchkey1#') or (URL_Link='#URLadd#')
</cfquery>

<!--- <cfif #getsign.recordcount# eq 0> --->
<cfquery name="insertName" datasource="adsbus">
insert into abus_b
values (N'#trim(form.roadNo)#',
N'#trim(form.searchkey)#',
N'#trim(form.searchkey1)#',
'#cgi.remote_addr#',
#now()#
)
</cfquery>

<!--- </cfif> --->

</body>
</html>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 13, 2006 Jul 13, 2006

Copy link to clipboard

Copied

chinaeye wrote:
> values (N'#trim(form.searchkey)#',

that looks like ms sql server syntax. is that right for mysql?

> <cfinclude template="static_htmlbus.cfm">

do these includes also have cfprocessingdirectives?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 14, 2006 Jul 14, 2006

Copy link to clipboard

Copied

Hi,PaulH,
Yes, the mysql 5 can take most of the MS SQL 2000 query...
after my hosting side specify the connection string "using useUnicode=true&characterEncoding=utf8",
the insert of Chinese characters works fine.

The only issue is the retirving and display those chinese characters. now the web page display like ??????????

It is my first hung the question for few days....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 14, 2006 Jul 14, 2006

Copy link to clipboard

Copied

chinaeye wrote:
> Hi,PaulH,
> Yes, the mysql 5 can take most of the MS SQL 2000 query...
> after my hosting side specify the connection string "using
> useUnicode=true&characterEncoding=utf8",
> the insert of Chinese characters works fine.

how do you know it works "fine"? you can't rely on mysql admin tools for that.

> The only issue is the retirving and display those chinese characters. now the
> web page display like ??????????

garbaged encoding. still not sure the data is being inserted properly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 14, 2006 Jul 14, 2006

Copy link to clipboard

Copied

Hi,PaulH,
Thanks, I found the way, you are right, I remove the N' in the query...and insert again,
Although the chinese looks like garbaged encoded in the mysql database this time, but when I retrived it, IT IS COOL AND PRETTY!

Those Chinese directly insert from database level, although no problem, but coldfusion page cannot display it well, just ???.

Those Chinese I inserted from Coldfusion page with the N' in front, it is the same like the database level insertion, display like ???.

So I know the truth! and how to insert and retrive Chinese in New platform.-----insert into mySQL from the Coldfusion page without the N' in front of the query, and the retrive, display chinese characters should be OK!

Thanks, Cheers for Coldfusion,

Cheers for adsbus.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 14, 2006 Jul 14, 2006

Copy link to clipboard

Copied

LATEST
chinaeye wrote:
> Those Chinese directly insert from database level, although no problem, but
> coldfusion page cannot display it well, just ???.

yes, you can't rely on the db tools to check this sort of thing.

again i think you ought to make use of cfqueryparam.

> Cheers for adsbus.com

btw there are several free cf based blogs & bbs around.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 14, 2006 Jul 14, 2006

Copy link to clipboard

Copied

chinaeye wrote:
> values (N'#trim(form.searchkey)#',
> N'#trim(form.searchkey1)#',

btw you really should be using cfqueryparam for all these.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2006 Jul 13, 2006

Copy link to clipboard

Copied

I checked the mysql 5, chinese is ok.

------------------here is the display page chinese like ?????--------------------------


<cfprocessingdirective pageEncoding="utf-8">
<cfset setEncoding("FORM", "utf-8")>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<html>
<head>
<title>Untitled</title>
</head>
<body>
<cfquery name="createhtml" datasource="adsbus">
SELECT *
FROM `abus_html`
WHERE 1
LIMIT 0 , 30
</cfquery>
<cfoutput query="createhtml">#Domain_Name# ,#URL_Link#,#IP#,#Date_Add#,#Comments# <p></cfoutput>


<p><p>

<cfquery name="createhtml" datasource="adsbusco">
SELECT Domain_Name
FROM abus_html
</cfquery>
<cfoutput query="createhtml">#Domain_Name# <p></cfoutput>
</body>
</html>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2006 Jul 13, 2006

Copy link to clipboard

Copied

Thanks, PaulH, my application running fine in Window2003 English OS,
but when we moved to redhat...the problem comes out...
Please help, thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation