Unicode character retrieval from MS-Access

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.
Who is Participating?
jjafferrConnect With a Mentor Commented:

I did a search on the internet to find some info on your language,
I selected www.thatstelugu.com/
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 http://www.bitstream.com/,
One of the Group companies have a Font Forum http://www.myfonts.com/FontForums/
Why don't you check it out, there might be there something for you.

Please see http://www.aksharamala.com/forums/archive/index.php/f-62.html
for conversions of fonts programatically.

check http://www.software-x.com/software/hindi.html
for more details about the same.

A bit more about your Character set http://www.eki.ee/letter/sources.html

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,

Please select Indian Language in your IE

Best Regards

Hi saritha_m123,

please see the following link, it might be of help

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

saritha_m123Author Commented:
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.
please excuse my ignorance, but is data.In JSP written in ASCI where you can open a Note Pad and read it? like HTML.

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

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

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

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

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

saritha_m123Author Commented:
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.
Steve BinkCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.