Inputting Greek in a simple input form to SQL DB

Posted on 2004-10-22
Last Modified: 2012-05-05
Hello there experts,

This must be a rather simple question, but I need your help:

I have an intranet website that collects different languages such as English, Portugese, Italian, French, Japanese etc. The first languages I all handle with Unicode, the last with SHIFT_JIS.

However, now that we want to add Greek to it, I'm seeing problems not with the display side of things, but with getting form input to our SQL database. Let me explain:

Whenever I type Greek data using the built-in Windows Language Bar (;en-us;306993&sd=tech) DIRECTLY into SQL, the data is saved normally and displays fine when fetched in ASP. However, when I do the same thing and type the data in a web form first (displays fine) the data doesn't get saved in SQL proper.

Strangest thing is that our web applications are working fine for all those other languages...

This is the code I used for setting our web apps to Unicode:
strCharset = "UTF-8"
Response.Charset = "utf-8"
Session.Codepage = 65001
<META http-equiv=Content-Type content="text/html; charset=<%= strCharset %>">

So this is what I did for Greek (since as with Japanese input, Unicode didn't work):
strCharset = "iso-8859-7"
Response.Charset = "iso-8859-7"
Session.Codepage = 1253
<META http-equiv=Content-Type content="text/html; charset=<%= strCharset %>">

Am I using the wrong charset or codepage here? Please advise!

Question by:vpikula

    Author Comment


    LVL 2

    Expert Comment

    I believe the problem lies in http, the form sends the data to the next page as ascii which doesn't support the greek alphabet.
    My best bet is to create a javascript that converts the greek letters into ascii before sending them to the next page!

    Author Comment

    That's a good point -- So I need to convert the form data to html codes first? Do you have a good function for that? (seems quite manual...)
    LVL 2

    Accepted Solution

    It would be something like this in ASP:
      Function translate(string)
        convertor = "&#945;@&alpha;|&#946;@&beta;|.....etc"
        convertor = split(convertor, "|")

        loops = UBound(split(convertor, "|"))

        FOR i=0 TO loops
          loopy = split(convertor(i), "@")
          string = replace(string, loopy(0), loopy(1))
      End Function
    This function has to be preformed before you send it though!

    Author Comment

    Hmmm yes that will do for converting it from Unicode to HTML codes I guess -- will give that a go and award you the points nonetheless, closing this old topic.

    Many thanks,

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    913 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now