codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Unicode help  genius_kanwal at 18:59 on Saturday, January 12, 2008
 

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="/forum/out2.txt";
#$outfile="/forum/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









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  connecting to Data.SqlClient
•  Re: display an image held in a sql database (image datatype) in to a datalist
•  I NEED C++ FOR PCSX2
•  download files via http in perl
•  Re: Help: Trouble with z-Index and SELECT lists
•  Unicode help
•  Re: open excel file in html page
•  Please review my website
•  problems involving bugs


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008