Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Inputting Greek in a simple input form to SQL DB

Posted on 2004-10-22
6
Medium Priority
?
780 Views
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 (http://support.microsoft.com/default.aspx?scid=kb;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!

Thanks,
Victor
0
Comment
Question by:vpikula
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 

Author Comment

by:vpikula
ID: 12472314
Anyone??

Victor
0
 
LVL 2

Expert Comment

by:seloh
ID: 12542683
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!

http://www.alanwood.net/unicode/greek.html
0
 

Author Comment

by:vpikula
ID: 12643632
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...)
0
 
LVL 2

Accepted Solution

by:
seloh earned 2000 total points
ID: 12829461
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))
    NEXT
  End Function
%>
This function has to be preformed before you send it though!
0
 

Author Comment

by:vpikula
ID: 12829602
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,
Victor
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

618 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