473,378 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Unicode help

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.:

Expand|Select|Wrap|Line Numbers
  1. $infile="out2.txt";
  2. #$outfile="out.txt";
  3. #open (FH,">:utf8",$outfile);
  4.  
  5. open(F,"<:utf8",$infile);
  6.  
  7. while(<F>){
  8. chomp;
  9.  
  10. binmode(STDOUT,":utf8");
  11.  
  12. print "$_"."\n";
  13.  
  14. }
  15. if($_ == /\x{0932}/)
  16. {
  17.  
  18. print "L"; 
  19. }
  20. $strvar="\x{0932} \x{0917}";
  21. print $strvar."done"."\n";
  22. #print FH $strvar."\n";
  23. 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
Jan 12 '08 #1
2 2592
eWish
971 Expert 512MB
Welcome to TSDN!

When you insert the data are you using placeholders? Are you expecting to see the hexadecimal representation in the db or the actual character after the insert?

--Kevin
Jan 13 '08 #2
Can I hijack this thread? I'm having exactly the same problem.

Yes, I'm using placeholders to insert data in MSAccess. From in MSAccess I see the UTF8 characters as two separate characters.

When I'm doing a select from Perl, I do get the characters in UTF8 format back (when printing to a file).

So it seems perl treats characters as 8 bit objects, splitting up UTF8 characters in 2 (or more) pieces. Because in MSAccess each 8bit part of the UTF8 character is visible as a separate character

I'm using activestate Perl 5.10 with DBD::ADO

Bart
Jan 30 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

30
by: aurora | last post by:
I have long find the Python default encoding of strict ASCII frustrating. For one thing I prefer to get garbage character than an exception. But the biggest issue is Unicode exception often pop up...
2
by: Rodger Dodger | last post by:
Hi there. We have an application that can run on a non-unicode or a unicode sql server database. Currently the application is running in a unicode database, as a non-unicode database is less...
27
by: EU citizen | last post by:
Do web pages have to be created in unicode in order to use UTF-8 encoding? If so, can anyone name a free application which I can use under Windows 98 to create web pages?
4
by: fowlertrainer | last post by:
Hi ! I want to get the WMI infos from Windows machines. I use Py from HU (iso-8859-2) charset. Then I wrote some utility for it, because I want to write it to an XML file. def...
4
by: webdev | last post by:
lo all, some of the questions i'll ask below have most certainly been discussed already, i just hope someone's kind enough to answer them again to help me out.. so i started a python 2.3...
18
by: Ger | last post by:
I have not been able to find a simple, straight forward Unicode to ASCII string conversion function in VB.Net. Is that because such a function does not exists or do I overlook it? I found...
6
by: Jeff | last post by:
Hi - I'm setting up a streamreader in a VB.NET app to read a text file and display its contents in a multiline textbox. If I set it up with System.Text.Encoding.Unicode, it reads a unicode...
14
by: abhi147 | last post by:
Hi , I want to convert an array of bytes like : {79,104,-37,-66,24,123,30,-26,-99,-8,80,-38,19,14,-127,-3} into Unicode character with ISO-8859-1 standard. Can anyone help me .. how should...
19
by: Thomas W | last post by:
I'm getting really annoyed with python in regards to unicode/ascii-encoding problems. The string below is the encoding of the norwegian word "fødselsdag". I stored the string as "fødselsdag"...
24
by: Donn Ingle | last post by:
Hello, I hope someone can illuminate this situation for me. Here's the nutshell: 1. On start I call locale.setlocale(locale.LC_ALL,''), the getlocale. 2. If this returns "C" or anything...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.