
genius_kanwal
New User
Jan 12, 2008, 11:54 AM
Post #1 of 1
(2474 views)
|
Before I begin to explain my problem, I just want to say that I can do the following two things: 1. Using Perl, connect to a MS Access Databse Table and perform the required operations.(Database is in English language) 2. I can read and write UTF8 text files using Perl. The following code explains how do I write UTF8 files.: $infile="out2.txt"; #$outfile="out.txt"; #open (FH,">:utf8",$outfile); open(F,"<:utf8",$infile); while(<F>){ chomp; binmode(STDOUT,":utf8"); print "$_"."\n"; } if($_ == /\x{0932}/) { print "L"; } $strvar="\x{0932} \x{0917}"; print $strvar."done"."\n"; #print FH $strvar."\n"; close(F); Here, I am reading from one UTF8 file and writing to another UTF8 file. Also, in the new UTF8 file I am adding two more characters whose hex values are there in the variable "strvar" as can be seen in the program. Now when I see this file in Wordpard or Notepad everything is fine. Now I come to my question. I have enabled Hindi Language/Internationalization support on my machine. If I directly try to write Hindi to the tables in MS Access, I am able to do that. Now the problem is that when I try to insert a string into MS Access from Perl whose Hex value(Unicode) is \x{0932} it does not appear correctly in the table. The Character that should appear corresponding to 0932 Hex is shown below(You can see this if you have Unicode support on your machine). ल However, instead of the above character, some garbled character is displayed on the screen. I dnt know how to insert unicode characters into MS Access from Perl(That is issuing a insert query from Perl to insert unicode strings). I need urgent help on this. I would really appreciate if someone could help me out. thanks in advance. Kanwaljeet
|