Unicode character retrieval from MS-Access

Posted on 2004-04-23
Last Modified: 2013-12-03
I have been using MS-Access 2000 with Windows XP.I am storing Indian Language (telugu ) data in the databse by using Gautami Font ( unicode characters).i can view them in the databse. but when i retrieve those values using JSP & display on web page i am ending up with (?) marks instead of the data.In JSP i have written the encoding part .The driver used is Type 1 JDBC-ODBC driver. The browser supports UTF-8.Can u pls let me know where the problem is & the solution for this.
  thanks in  advance.
Question by:saritha_m123

Expert Comment

ID: 10906524
Please select Indian Language in your IE

Best Regards

LVL 27

Expert Comment

ID: 10906570
Hi saritha_m123,

please see the following link, it might be of help


Author Comment

ID: 10915950
hi Benjamin,
   Thanks fo rthe answer you have given.but i have already set the language option in IE .I had doubt with the Odbc driver so i even tried using JDataConnect driver & then tried out the samething but of no use. I am ending up in (?) marks.Pls  help me out.
  No problem with the browser , when i enter a value in a textbox & then try to display it on browser then i am able to do it perfectly. I mean to say Indian Languages data is displayed on the browser.I am having problem while retrieving   from the database.
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

LVL 27

Expert Comment

ID: 10915967
please excuse my ignorance, but is data.In JSP written in ASCI where you can open a Note Pad and read it? like HTML.


Author Comment

ID: 10916632
hello jaffer,
    Yes, in JSP the data is written in ASCI . we can read it in notepad like HTML.The mian problem is while I retrive from databse then the actual encoding is not being done.
   As i mentioned earlier I have used result_set.getUnicodeStream("emp_name");
  to retrive the unciode charcters from databse.
   In MS-Access I can view the data in my local language.
I hope now u undertsan dmy problem.
LVL 27

Expert Comment

ID: 10916679
I am not a pro, so I do things in a lower level,
I don't understand result_set.getUnicodeStream("emp_name");
so, lets do a test to find where the problem is (I did an HTML project with a Arabic fonts, so similar to your project):

Open your JSP data in a Note Pad and see if it is readable,
if it is NOT, then we will have to export it from Access in another way.


Author Comment

ID: 10945974
hello jaffer,
   I am using JSP ( Java Serv er Pages) & writing the web page .There i hvae been doing encoding.when i write a normal page & take a value from Textbox & thene display I am getting the encoding being done.But when i Try to get from database then i am having probl.
   Pls give me solution.
LVL 27

Expert Comment

ID: 10946587
I asked you something, but you didn't tell me the result, so I am asking you again,
Please do a test and tell me the result:
1- Export from your mdb to jsp.
2- open the exported file in Note Pad. Is it readable OR you get ????

I am trying to find where the problem is, so you have to follow with me please.

you have 3 places where things can go wrong:
1- Database, but you can read things OK there.
2- Outside Database:
A- Is it Wrong way to Export, so characters are not sent correctly,
B- Characters are Exported correctly, but the Internet Explorer setting needs to be adjusted.

Please do the test and give the result, so that we can take the next step.


Author Comment

ID: 10958408
hello jaffer,
    As u said there is no option to export from mdb to jsp.But there is an option from mdb to ASP. So i have exported into ASP & then I have run the file on IIS server.I could view the data on the web page in local languages.I am unable to understand the probl.
        When i write the same code in JSP( with differnet encodings) , I am unable to get the values. but in ASP I am getting the values ..So pls tell me where the probl is?  
  Is that b'cos Access & ASP are Microsoft Products.
   Do u know any way of exporting mdb into JSP?
  pls do reply.
LVL 27

Expert Comment

ID: 10958829
Hi Saritha
Not only mdb and jsp have a communication problem, it seems you and I have a communication problem too :-(
I have asked you to preform a task in my last comments, but you havn't done it, so I don't realy know if I can help.
I understood your problem, and I want to help, but you have to provide to me what I asked for.
please read my last comment and reply.


Author Comment

ID: 11003253
hi jaffer,
    As u said I have exported to a text document , then I got (?) marks. I hope this is the test u have asked me to perform.If this is not the test plss repeat the test.
LVL 27

Expert Comment

ID: 11003336
That is the Test,
Now we know the problem is NOT from your IExplorer encoding, but it is the way you export your data from your mdb.

lets try this way to export to a text file:

Open "C:\DeleteMe.rtf" For Output As #1    ' Open file for output.
Print #1, [AnyFieldName1]                     ' Print text to file.
Print #1, [AnyFieldName2]                     ' Print text to file.
Close #1

AnyFieldName1 is a Name of a field with your language data in it
AnyFieldName1 is a Name of another field with your language data in it

Then open the file and see if you can read the field value.


Author Comment

ID: 11029907
hi jaffer,
    I have tried to export as u said .Then I got only (?) marks in the text file.
    If i place the unicode hexadecimal eauivalent values of the local language chaarcters in MS-Access then i am getting the display of local language on the browser.
   but if directly place local language data , then I am getting (?) marks.
LVL 27

Expert Comment

ID: 11031061
Now you know where your problem IS.
It is the Export from Access.
Now you know that you have to Export with the unicode hexadecimal equivalent values of the local language charcters from Access to JSP (I will use html extension for my example so that you can view it in IExplorer)

Make a Code to convert your Field from Access to the unicode hexadecimal equivalent values of the local language charcters:

I am going to show you a sample of what you should do, as I don't know the hexadecimal equivalent of your characters.

I will Assume you have 2 Fields, txtData1 and txtData2 which contains the Data required to transfer to html,

You have 2 ways to do this,
1- Make another Fields for these hexadecimal eauivalent OR better, make a Table for them.
2- Export the Fileds to gether to an html file.

I will use the 2nd way as it involves more work, but you can use way 1 and take from the code what is required to convert to hexadecimal eauivalent.

This should be in your Form, maybe of a click of command button:

[AllData]=[txtData1] & [txtData2]   'we put together the fields together in 1 field
MyLanguage=ConvertLanguage([AllData])    'We are calling a Function called ConvertLanguage and sending the field [AllData] to it.

This Function will be saved in the module.
We will take each character from [AllData] and convert that character to hexadecimal equivalent values of the local language charcters, then combine these converted values and send this to html file.

Save the code below to a module, call it JSPCharacterSet

Function ConvertLanguage(OldData)

    Dim MyChar,  NewCharacters, i,OldData
    Open "C:\TestFiel.html" For Output As #2    ' Save file.
    NewCharacters= ""

        For i = 1 To Len(OldData)
            MyChar = Mid(OldData, i, 1) 'Read 1 character at a time of the field

    If MyChar = "`" Then MyChar = "ذ"   'OR If MyChar = "`" Then MyChar = Hex(10)
    If MyChar = "q" Then MyChar = "ض"
    If MyChar = "w" Then MyChar = "ص"  ' Convert each character in the field from Normal to Hex
    If MyChar = "e" Then MyChar = "ث"
    If MyChar = "r" Then MyChar = "ق"
    If MyChar = "t" Then MyChar = "ف"
    If MyChar = "y" Then MyChar = "غ"
    If MyChar = "u" Then MyChar = "ع"
    If MyChar = "i" Then MyChar = "ه"
    If MyChar = "o" Then MyChar = "خ"
    If MyChar = "p" Then MyChar = "ح"
    If MyChar = "[" Then MyChar = "ج"
    If MyChar = "]" Then MyChar = "د"
    If MyChar = "a" Then MyChar = "ش"
    If MyChar = "s" Then MyChar = "س"
    If MyChar = "d" Then MyChar = "ي"
    If MyChar = "f" Then MyChar = "ب"
    If MyChar = "g" Then MyChar = "ل"
    If MyChar = "h" Then MyChar = "ا"
    If MyChar = "j" Then MyChar = "ت"
    If MyChar = "k" Then MyChar = "ن"
    If MyChar = "l" Then MyChar = "م"
    If MyChar = ";" Then MyChar = "ك"
    If MyChar = "'" Then MyChar = "ط"
    If MyChar = "z" Then MyChar = "ئ"
    If MyChar = "x" Then MyChar = "ء"
    If MyChar = "c" Then MyChar = "ؤ"
    If MyChar = "v" Then MyChar = "ر"
    If MyChar = "b" Then MyChar = "لا"
    If MyChar = "n" Then MyChar = "ى"
    If MyChar = "m" Then MyChar = "ة"
    If MyChar = "," Then MyChar = "و"
    If MyChar = "." Then MyChar = "ز"
    If MyChar = "/" Then MyChar = "ظ"
            NewCharacters = NewCharacters & MyChar   'Add the converted Hex fields
        Next i

            Write #2, NewCharacters    'write the New Hex field to the File.
            NewCharacters= ""
    Close #2
End Function

This gives you the way to do your conversion from Access to your browser correctly.
You might have to fine tune the code to suite you.

I hope this helps you finish your project.


Author Comment

ID: 11047035
hello jaffer,
     My project is about storing values in databse dynamically & then later on retreiving them.U have suggested me to write the function where for each character hexadecimal equivalent is given.But how can I know what is the heaxadecimal equivalent for each character in telugu(my language).I have some 100s of characters.
    I even cant guess what the user will be entering the details.Is there any code so that I can convert the characters into hexadecimal.
    Actually I have some code which converts the characters into unicode but of different format i.e.
    \u0c32\u0c41      (format 1)
    this is equivalent to
   లు     (format 2)
   when i store in the databse with format 2 I am able to display the language data on browser.
   but when i store in format 1 I am getting unicode characters instead of language data( i.e. \uoc32\uoc41 instead of my lang data)
    I have amethod which converts lang data into format 1 but no method to convert from data to format 2.
    Please let me know what can i do now? pls..
       More over now I have changed to MS-access XP.
  Now when i export to text file then I am getting the lang data without (?) marks.
LVL 27

Accepted Solution

jjafferr earned 125 total points
ID: 11048174

I did a search on the internet to find some info on your language,
I selected
once you click on it, it brings up a Security Alert to install a Cockie, from BitStream WebFont player,
Clicking on their name took me to their site,
One of the Group companies have a Font Forum
Why don't you check it out, there might be there something for you.

Please see
for conversions of fonts programatically.

for more details about the same.

A bit more about your Character set

For what I can do, I did a small code where I usually get my Ansi chacater set  from,
Here you can do your conversion and see your Hex value of the character, I assigned it to a field called Text0:

For i = 1 To Len([Text0])
    OneChar = Mid([Text0], i, 1)
    MsgBox OneChar & "-" & Asc(OneChar) & "-" & Hex(Asc(OneChar))
Next i

Investigate to see how you were able to get (format 2) and build a conversion code like what I showed you.

Sorry, but seems, this is where you have to go further in investigation.

Good Luck,

LVL 50

Expert Comment

by:Steve Bink
ID: 11957932
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

Accept - jjafferr

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question