J
Jason Quek
Hi
I have a Unicode (utf8) file containing Unicode characters. I need to
open this file, read each line, then save it to an Access database
table via SQL.
This is my script:
#--------------------------------------------------
$file = 'unicode.txt';
open (FILE, "$file") || print "cannot open $file: $!";
while (<FILE>)
{
$name = $_;
$sql = "INSERT INTO `sql_table` VALUES ('$name')";
&execute_sql;
}
#--------------------------------------------------
However, what gets inserted into the Access table does not match the
original characters.
What am I doing wrong, and what is the correct way to read the Unicode
file and save the contents?
I have looked at the "Unicode::String" module, but am not sure how to
use it in my case.
Any help would be appreciated.
Thank you and regards,
Jason Q.
I have a Unicode (utf8) file containing Unicode characters. I need to
open this file, read each line, then save it to an Access database
table via SQL.
This is my script:
#--------------------------------------------------
$file = 'unicode.txt';
open (FILE, "$file") || print "cannot open $file: $!";
while (<FILE>)
{
$name = $_;
$sql = "INSERT INTO `sql_table` VALUES ('$name')";
&execute_sql;
}
#--------------------------------------------------
However, what gets inserted into the Access table does not match the
original characters.
What am I doing wrong, and what is the correct way to read the Unicode
file and save the contents?
I have looked at the "Unicode::String" module, but am not sure how to
use it in my case.
Any help would be appreciated.
Thank you and regards,
Jason Q.