Professional Web Applications Themes

Inserting Thai characters to a database - Coldfusion - Advanced Techniques

I'm trying to insert Thai characters into my MsSQL databse. We have developed an online survey which is in Thai. The survey reads questions from our database to the screen and records the answers on a scale of 1-5. I've copied and pasted the questions into Enterprise Manager and the Thai questions appear fine on the screen. My problem is at the end of the survey the user has to enter their details. These will be Thai characters. When I try and insert these into the database through the <cfquery> tag I get a whole heap of ????????????? Here's my ...

  1. #1

    Default Inserting Thai characters to a database

    I'm trying to insert Thai characters into my MsSQL databse.

    We have developed an online survey which is in Thai. The survey reads
    questions from our database to the screen and records the answers on a scale of
    1-5.

    I've copied and pasted the questions into Enterprise Manager and the Thai
    questions appear fine on the screen.

    My problem is at the end of the survey the user has to enter their details.
    These will be Thai characters.

    When I try and insert these into the database through the <cfquery> tag I get
    a whole heap of ?????????????

    Here's my query:

    <cfquery name="insertDetails" datasource="myDatasource">
    INSERT INTO Survey_Cesar_Comments(Firstname, Surname, Address, Address2,
    Province, Postcode, Phone, Email, Comments)
    VALUES('#Form.firstname#', '#Form.surname#', '#Form.address#'
    ,'#Form.address2#', '#Form.Province#', '#Form.postcode#', '#Form.phone#','
    #Form.email#', '#Form.comments#')
    </cfquery>

    I've also tried using the <cfprocessingdirective pageencoding="utf-16"> tag
    but this gives me a whole heap of junk on the screen.

    Any help is much appreciated here as I'm tearing my hair out

    someonePleaseHelpMe Guest

  2. #2

    Default Re: Inserting Thai characters to a database

    someonePleaseHelpMe wrote: 

    what version of cf? if mx, what db driver are you using?
     

    no, that's not the way to handle this sort of thing. you'll end up
    confusing yourself no end. you should have a web based app to manage the
    data. once you get that straight, everything else is simple.
     

    encoding issue. the data is garbaged.
     

    how are the char columns defined? "N" datatypes? if so, why aren't you
    using unicode hinting (N'#Form.firstname#', etc.). and finally why
    aren't you using cfqueryparam?
    PaulH Guest

  3. #3

    Default Re: Inserting Thai characters to a database

    PaulH *TMM* if I could see you now Id give u a big kiss!!!!

    That was absolutly wrecking my head and the N data types solved it....

    U beauty.....
    someonePleaseHelpMe Guest

  4. #4

    Default Re: Inserting Thai characters to a database

    someonePleaseHelpMe wrote: 

    you *really* should be using cfqueryparam on a public facing site. when
    you do, read this too:

    http://www.sustainablegis.com/blog/cfg11n/index.cfm?mode=entry&entry=F9553D86-20ED-7DEE-2A913AFD8651643F

    PaulH Guest

Similar Threads

  1. Question example for inserting double byte characters into db2 database in vb.net
    By Unregistered in forum Brainstorming Area
    Replies: 0
    Last Post: September 10th, 10:01 AM
  2. Inserting Special Characters
    By eagle in forum ASP.NET Data Grid Control
    Replies: 3
    Last Post: November 29th, 08:04 AM
  3. Inserting characters in Illustrator 9.0
    By Jennifer_McClure@adobeforums.com in forum Adobe Illustrator Windows
    Replies: 5
    Last Post: April 20th, 03:33 PM
  4. Replies: 1
    Last Post: August 12th, 03:28 PM
  5. Inserting Thai text
    By BobHill in forum Adobe Photoshop Elements
    Replies: 2
    Last Post: July 17th, 06:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139