Though I developed a full fledge application in Punjabi for Complaint Management Branch of DC Office in Punjabi, but yesterday I faced a hrassing issue of POSTGRESQL. I did not know why it happened, why I was not able to resolve it yesterday?
I was testing the application yesterday on Windows , because I am making the application Cross Browser Compatible and yes OS Independent too. Thatzz why I need testing. But I faced very absurd issue, absurd so because i did it earlier and now i am not being able to understand it. Actually while Entering data in Punjabi I realized data being entering in glyph form.
At first I realized that issue might be non- rendering of Unicode by windows, so i make some changes in php files to make it work. But then i realized that something is wron with the database. I found that LC_Collate and LC_Ctype (i.e localization issue was there). So, I keep on searching and searching to change the locale (which was the main blunder I was making.)
I even changed the OS system locale and tried for that but not complete results obtained.
And Today In the evening when I was sleeping consciously, I realised that I had heard about a 'C' being used in lc_collate and lc_ctype . I kept on thinking What was that?
Then I understood that this is what i was looking for, setting lc_collation and lc_ctype to 'C' and defining encoding to UTF-8 will make you to enter any sort of language supporting unicodes.
In linux one is not going to face such issues because in that what you need to do is that.
Go, to System->Administration->Language Support.
You will see two tab . 1) Language and 2) Text
Select English(Indian) after that installing postgresql will set your database to default locale of 'en_IN' which will allow to enter hindi, punjabi, english and any language that India supports. ;-)
But it sets this to default , if you will fall in love with latin or greek some day and wants to enjoy those beautiful structure of glyph of these language in db you wont be able to do it with your predefined lc_collation.
In that case and in case of windows you have to use lc_collation and lc_ctype to be 'C'.
Not a big thing to do that just define this thing while creating database.
See some screenshot below:-
[caption id="attachment_72" align="aligncenter" width="1024" caption="LC_COLLATION and LC_CTYPE"][/caption]
Another image show data stored in punjabi.
[caption id="attachment_73" align="aligncenter" width="1024" caption="Punjabi Data Entered in POSTGRESQL"][/caption]
I was testing the application yesterday on Windows , because I am making the application Cross Browser Compatible and yes OS Independent too. Thatzz why I need testing. But I faced very absurd issue, absurd so because i did it earlier and now i am not being able to understand it. Actually while Entering data in Punjabi I realized data being entering in glyph form.
At first I realized that issue might be non- rendering of Unicode by windows, so i make some changes in php files to make it work. But then i realized that something is wron with the database. I found that LC_Collate and LC_Ctype (i.e localization issue was there). So, I keep on searching and searching to change the locale (which was the main blunder I was making.)
I even changed the OS system locale and tried for that but not complete results obtained.
And Today In the evening when I was sleeping consciously, I realised that I had heard about a 'C' being used in lc_collate and lc_ctype . I kept on thinking What was that?
Then I understood that this is what i was looking for, setting lc_collation and lc_ctype to 'C' and defining encoding to UTF-8 will make you to enter any sort of language supporting unicodes.
In linux one is not going to face such issues because in that what you need to do is that.
Go, to System->Administration->Language Support.
You will see two tab . 1) Language and 2) Text
Select English(Indian) after that installing postgresql will set your database to default locale of 'en_IN' which will allow to enter hindi, punjabi, english and any language that India supports. ;-)
But it sets this to default , if you will fall in love with latin or greek some day and wants to enjoy those beautiful structure of glyph of these language in db you wont be able to do it with your predefined lc_collation.
In that case and in case of windows you have to use lc_collation and lc_ctype to be 'C'.
Not a big thing to do that just define this thing while creating database.
See some screenshot below:-
[caption id="attachment_72" align="aligncenter" width="1024" caption="LC_COLLATION and LC_CTYPE"][/caption]
Another image show data stored in punjabi.
[caption id="attachment_73" align="aligncenter" width="1024" caption="Punjabi Data Entered in POSTGRESQL"][/caption]