Sunday, August 29, 2010

Today’s Tips – Use Thailand Character, Database Collation

Here I am again, with the problem : how to use non-Latin characters in your Application ?

at the Programming side, you need configure the ColdFusion so it can support the non-Latin characters, please see my previous post that explain how to do it, but now, we’ll go with the database.

I assume you usually creates an application in EN localization, that’s why, by default, all the setting will refer to EN. included your SQL database collation, which by default, it can not merely accept the Thailand’s characters since the Collation is Latin. the solution is : you need to update the Database and Table Column’s Collation.

Collation for EN localization default is SQL_Latin1_General_CP1_CI_AS (at least this default collation where my Computer Server is installed)

in Thai, you need to use THAI_CI_AS collation (at least this what I used by now, probably you can use THAI_CI or other THAI collation).

1. Update Database Collation. to Alter the database collation, you can go to SQL Management, under the Object Browser, find the database you want to alter. then right-click to edit the database properties. you will find Collation options in the pop up screen, then you need to select the THAI_CI_AS for the database collation.

please note that you can update the collation if Database is not being used, if it is, then you can Restart the SQL server and try again.

2. Update Table’s Column Collation. You can run this SQL script to alter the column’s collation. (just example, you can modify the table name and column name) :

 ALTER TABLE temployee ALTER COLUMN first_name varchar(50) COLLATE THAI_CI_AS  


Then now, after you update the database and table’s column collation, you Now should be able to put Thai character to the database. This solution can be implemented in Database which has only less number of tables, but how if you has hundreds of Tables ? please find the tips on my next Post :)



Until next time, keep cheer up !

Today’s Tips – Use Thailand Character in ColdFusion

images Have you guys ever involved in project where you need to use non-Latin character ? I did

I came across with problem to make my application to run the Thailand’s characters. if you usually develop the CF application in English localization, probably, you cannot merely apply the foreign characters. (you will find the characters in unknown format)

and how the simplest way to solve this ?

Update the ColdFusion encoding to UTF-8. you can do this by go to CFIDE administrator, under Java and JVM tabs, and in the JVM Parameters, add the additional Parameter : -encoding=UTF-8

and Restart your CF application server

Now you should be able to put the Thailand’s characters in your CF application. I never used any other characters except Latin and Thai, but I’m pretty sure it will be the same encoding if you want to use another characters such as Chinese, Russian, or maybe Arabian.

well, after this, you probably will find another problem, in regard to the database collation. I will give you some tips in my next post,

Hope can Help,

Stay tune and Cheer up your Monday !!

Friday, August 27, 2010

Hello ! ColdFusion

been so long time no write anything on this site, what can I say, I just want to say hello !

wonder how to write this in ColdFusion ? for you who never know ColdFusion before please use this line :

 <cfoutput>  
Hello
</cfoutput>


finally, welcome to Coldfusion readers !