Skip to main content
Known Participant
September 7, 2006
Question

Language setting problem

  • September 7, 2006
  • 18 replies
  • 1330 views
Hi,

I have an language setting problem about the forum. I wanna show Chinese characters in the forum. I have put the follow codes at in the beginning of every page:

<cfprocessingdirective pageencoding="big5">
<cfset setEncoding("URL", "big5")>
<cfset setEncoding("FORM", "big5")>

But it doesn't work. All the Chinese characters are shown as "???". I know there is another line of code may help:
<cfcontent type="text/html; charset=big5">

However, when I added the code to the pages, the header.cfm and footer.cfm page will not be shown (I used an index page to include the header, the content, and the footer by cfinclude) , and all the style cannot be applied.

Please help

FRANK
    This topic has been closed for replies.

    18 replies

    Known Participant
    September 7, 2006
    Sorry, I have just missed your post = P

    Most of the chinese characters I stored are using "nvarchar" datatype. However, the forum I purchased use "text" to store the data.

    I used the import wizard in MSSQL 2000 to transfer data from testing server to production server. Most of the chinese characters can be shown but a few columns which stores Chinese characters cannot be shown, only "???" can be displayed.

    I have tried to type chinese in the textbox and can be displayed properly
    Inspiring
    September 7, 2006
    ?? wrote:
    > How can i solve this encoding issue? actually I'm quite confuse about the
    > encoding setting s:

    you can start by answering my questions.
    Known Participant
    September 7, 2006
    I have put that 4 lines in the Application.cfm

    How can i solve this encoding issue? actually I'm quite confuse about the encoding setting s:

    1) Is there any different between using that 4 lines of codes and the encoding settings in DW --> page property?

    2) If the collation are different from the testing server (CFMX7 + MSSQL 2000) and the production server (CFMX6.1 + MSSQL 2000), is that a problem? A strange scenerio is that the data (chinese characters) I export from the testing server to the production server can be displayed through the web page without problem (although I can only see "??" in the database). However, the new chinese character I submit through the web form cannot be shown. What causes the problem?

    Inspiring
    September 7, 2006
    ?? wrote:
    > I have a testing server which is CFMX7 with MSSQL 2000 as the database. The

    what datatype are you using to store the chinese text? and what db driver are
    you using? it should not be ODBC.

    > SQL_Latin1_General_CP1_Ci_AS. After importing the data, most of the data can

    "most"?

    > still be displayed. However, the new data I submit through the form, like the
    > forum messages, were all shown as "???". I dunno what I have done wrong.

    see my 1st question. how did you import the data into your host's sql server &
    what did you import it from?

    test your text on this page:

    http://www.sustainablegis.com/unicode/greekTest.cfm

    it uses unicode but you should be able to make it work using big5 BUT your db's
    datatypes, etc. have to be correct.
    Inspiring
    September 7, 2006
    ?? wrote:
    > I have put these 4 lines in the cfm:

    what "cfm"?

    > And I put these 3 lines in every page

    > <cfset setEncoding("URL", "big5")>
    > <cfset setEncoding("FORM", "big5")>

    as i said these two don't need to be on every page, just in the application.cfm

    > as "???" if I submitted a form to the database. However, the chinese character
    > can be stored of I type them to the database directly

    encoding issue.

    Known Participant
    September 7, 2006
    Maybe I can describe a little bit more about my problem

    I have a testing server which is CFMX7 with MSSQL 2000 as the database. The default collation of the DB is CHinese_Taiwan_Stroke_AI_CS. I have stored so many data to test the finction of the problem, which most the them are CHinese characters and it works just fine. I have added these 3 lines at the beginning of most of the pages.

    <cfprocessingdirective pageencoding="big5">
    <cfset setEncoding("URL", "big5")>
    <cfset setEncoding("FORM", "big5")>

    After finishing the testing, I use import all the data to the databse provided by my web hosting company, which use CFMX6.1 and MSSQL 2000, with the collation SQL_Latin1_General_CP1_Ci_AS. After importing the data, most of the data can still be displayed. However, the new data I submit through the form, like the forum messages, were all shown as "???". I dunno what I have done wrong.

    Maybe I can ask the question in a simple way: where should i put these code?
    <cfprocessingdirective pageencoding="big5">
    <cfcontent type="text/html; charset=big5">
    <cfset setEncoding("URL", "big5")>
    <cfset setEncoding("FORM", "big5")>

    in the cfm page? in every simgle page? Is taht necessary to put it the page which use for insert the datainto the database? I'm really confusing.

    There is also a page property in DW to change the encoding. Should I use it?
    Known Participant
    September 7, 2006
    I have put these 4 lines in the cfm:
    <cfprocessingdirective pageencoding="big5">
    <cfcontent type="text/html; charset=big5">
    <cfset setEncoding("URL", "big5")>
    <cfset setEncoding("FORM", "big5")>

    And I put these 3 lines in every page
    <cfprocessingdirective pageencoding="big5">
    <cfset setEncoding("URL", "big5")>
    <cfset setEncoding("FORM", "big5")>

    I did not put <cfcontent type="text/html; charset=big5"> in every page coz, as i have said, the stlye and the fomat of the content were all gone and the header and footer page will not be displayed afterward.

    My testing server is MX7 and my production server is MX6.1, which is provided by a web hosting company. I found the CHinese characters will only be displayed as "???" if I submitted a form to the database. However, the chinese character can be stored of I type them to the database directly
    Inspiring
    September 7, 2006
    ?? wrote:
    > I have an language setting problem about the forum. I wanna show Chinese

    no, i think you have an encoding issue.

    > <cfprocessingdirective pageencoding="big5">

    good idea, this has to go on all pages.

    > <cfset setEncoding("URL", "big5")>
    > <cfset setEncoding("FORM", "big5")>

    these can go in the application.cfm or cfc, no need to stick them on all pages.

    > But it doesn't work. All the Chinese characters are shown as "???". I know
    > there is another line of code may help:

    what ver of cf? where's the chinese text data coming from? is it really big5
    encoded?