Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Internationalization (v4)
 Problem saving login cookies
 Forum Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

AhmadMoslem
Starting Member

15 Posts

Posted - 10 October 2002 :  03:46:14  Show Profile
When you try to login with standard character set, the login credentials are saved to the cookie and all is well ..

When trying to login with a unicode set of characters, then the login details are not saved and the user needs to put in his username/password all over again with every post.

Any ideas guys?

Ahmad
<

Deleted
deleted

4116 Posts

Posted - 12 October 2002 :  11:29:24  Show Profile
Did you try the cookie problem in a unchanged forum and using unicode? I don’t know if it is caused by the changes you made in your installation...

Are you using UTF-8 encoding? I waited for others to answer. Chinese, Japanese etc should have the same problem.
<

Stop the WAR!
Go to Top of Page

AhmadMoslem
Starting Member

15 Posts

Posted - 12 October 2002 :  12:52:29  Show Profile
Hello Bozden
I think that the problem is an UTF-8 encoding issue rather than anything else...
The Unicode characters are working fine on version 3.
I will change the 1256 bit, but can you please tell me what to replace the "<%@ Language=VBScript codepage=1256%>" with?
I tried replacing it with codepage=65001 but to no avail.
Thanks for your concern Bozden

Ahamd
<
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 13 October 2002 :  08:30:15  Show Profile
I posted to this yesterday but I hit a connection problem, so the answer is lost. Let me try to recover:

Please try these to find the reason:
1) Make sure you are using the same encoding everywhere. Either Windows-1256 OR utf-8. You cannot mix them. You need to use utf-8 in <%@ %> statement, in meta tags, in database, in browser when typing etc...
2) Create a test user, with username using only US-ASCII characters, check the cookie contents. Is it there as expected?
3) Do the same for non US-ASCII characters. Is it there as expected? Compare it with the value in the database.
<

Stop the WAR!
Go to Top of Page

beso
New Member

Finland
63 Posts

Posted - 19 October 2002 :  23:20:19  Show Profile  Visit beso's Homepage
I have the same problem with Georgian (or Russian) Unicode. It seems that unicode strigs (pass and name) can't be correctly saved in cookie.

While logging using Georgian Unicode name and pass first I have message: "You Logged on successfully..." and then everithing is as if I am not logged...

I tried to use:
<% @CODEPAGE="65001" @Language="VBScript" %>
<% Response.Charset="UTF-8" %>
<% Session.Codepage =65001 %>
but, no success...

From the other side using forum:
http://www26.brinkster.com/i2asia
there everything is working perfectly...

1.
On Internet Information Services (IIS) 5.0, Server.HTMLEncode incorrectly encodes data that is in a Unicode format, but correctly converts DBCS data.
IIS 5.0 steps to set up the ASP page to handle Unicode
Add the ASP CodePage directive to the first line of ASP code as follows:
<%@ Language=VBScript CodePage=65001%>
Insert the following lines of code after the CodePage directive:
<%Session.CodePage = 65001%>
Paste the following code in the HTML <HEAD> section of the ASP page.
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8">
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q261154&

2.
If your application uses Active Server Pages (ASP) and you are using Internet Information Server (IIS) 5.0 and Microsoft Windows 2000, you can add "<% Session.Codepage=65001 %>" to your server-side ASP script. This instructs IIS to convert all dynamically generated strings (example: Response.Write) from UCS-2 to UTF-8 automatically before sending them to the client.

If you do not want to enable sessions, you can alternatively use the server-side directive "<%@ CodePage=65001 %>".

Any UTF-8 data sent from the client to the server via GET or POST is also converted to UCS-2 automatically. The Session.Codepage property is the recommended method to handle UTF-8 data within a web application. This Codepage setting is not available on IIS 4.0 and Windows NT 4.0.
http://support.microsoft.com/default.aspx?scid=KB;EN-US;q232580&

3.
To specify the codepage for an ASP page, use the AspCodePage metabase property, the @CODEPAGE directive, the Session.CodePage property, or the Response.CodePage property. For example, to set the codepage to Japanese, set the AspCodePage property for your application to 932 using one of the following commands:
<%@ CODEPAGE = 932 %>
<% Session.CodePage = 932 %>
<% Response.CodePage = 932 %> <<<???>>>
Keep in mind that the ASP page must be saved in the file format that matches the @CodePage directive. For example, if @CodePage is set to 65001, the Web page must be saved in UTF-8 format. If @CodePage is set to 932, the Web page must be saved in ANSI format on a computer that has the default system locale set to Japanese.

When ASP sends a Web page to a browser, the browser needs to know what character set to use to display the page properly, and the language pack for that character set must be installed on the computer. To specify the character set, use one of the following commands:

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=windows-1251">
<% Response.Charset = "windows-1252"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/html/psdk/asp/eadg6e7n.asp

what can be correct dissision? who can interpret all this?<


Edited by - beso on 20 October 2002 04:07:49
Go to Top of Page

n/a
deleted

593 Posts

Posted - 20 October 2002 :  07:40:21  Show Profile
i2AsiaForum is deployed using utf-8 as a base enconding system. But, nothing was touched on a server side...which your above topics are primarily talking about.

Some of these issues were raised in conjunction with locale OS/Windows envirnment and setting regional locale/language selection and setting a proper encoding scheme for the forum...

i2AsiaForum is simply using the Forum as is with simply setting html encoding to utf-8 and Access 2000 DB. With V4b03.00x, you have to simply set
config.asp properly
convert all langNNN.asp (with locale language/target language strings translated) to utf-8 and save it in utf-8 encoding format.
ensure that html encoding setting in the forum (inc_top.asp, which should be "automatic" if properly defined in config.asp with language files).

There are extensive discussions on this topic since early this year - some may be in the archived international development forums.


-----
Beso - I had Russian also working at i2Asia before (currently disabled). Anyway, I setup a link for you. Please check it at i2Asia.
<

Taku

Edited by - n/a on 21 October 2002 08:46:07
Go to Top of Page

beso
New Member

Finland
63 Posts

Posted - 21 October 2002 :  11:54:04  Show Profile  Visit beso's Homepage
I have solved this problem[s]

A. Problem is that ASP/VB can't write/read unicode string to local cookies (cookies are pure ASCII files)...

B. Server produced html is not pure Unicode - produced code instead of pure Unicode simbols contains 3 byte for each Unicode simbol (this can be checked by viewing source from browser)...

My micro MOD to solve tis problem[s]:

1. All asp pages are to be written in utf-8 encoding (I used NotePad);

2. All ASP pages (exept includes) are to be started by:
<% @CodePage=65001 Language="VBScript"%>
<% Response.Charset="utf-8" %>
<% Session.Codepage=65001 %>


3. I have written and tested microMOD:

'##############################################
'## BPG Cookie Unicode Encode and Decode functions and Subs ##
'##############################################

function bpgUnicodeEncode(bpgStrUnicodeEncode)
for bpgAsoI = 4256 to 4351 ' Georgian Unocode range
bpgStrUnicodeEncode=replace(bpgStrUnicodeEncode, ChrW(bpgAsoI),"#" & bpgAsoI)
next
bpgUnicodeEncode = bpgStrUnicodeEncode
end function

function bpgUnicodeDecode(bpgStrUnicodeDecode)
for bpgAsoN = 4256 to 4351 ' Georgian Unocode range
bpgStrUnicodeDecode=replace(bpgStrUnicodeDecode, "#" & bpgAsoN, ChrW(bpgAsoN))
next
bpgUnicodeDecode = bpgStrUnicodeDecode
end function


This microMOD is to be placed into inc_functions.asp
Aim of this functions is to Encode/Decode Unicode string into ANSI/ASCII simbols for writing into cookies. I have Georgian Unicode range - this can be changed into any...

4. All cases of using

Response.Cookies(strUniqueID & "User")("Name")
Request.Cookies(strUniqueID & "User")("Name")
and
Response.Cookies(strUniqueID & "User")("Pword")
Request.Cookies(strUniqueID & "User")("Pword")

are to be modified to use abovementioned functions

For example from inc_top.asp:

if strAuthType = "db" then
if (Request.Cookies(strUniqueID & "User")("Name") <> "" and Request.Cookies(strUniqueID & "User")("PWord") <> "") then
'## Forum_SQL
strSql = "SELECT MEMBER_ID, M_NAME, M_PASSWORD "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE " & strDBNTSQLName & " = '" & ChkString(bpgUnicodeDecode(Request.Cookies(strUniqueID & "User")("Name")), "SQLString") & "' "
strSql = strSql & " AND M_PASSWORD = '" & ChkString(bpgUnicodeDecode(Request.Cookies(strUniqueID & "User")("Pword")), "SQLString") &"'"
Set rsCheck = my_Conn.Execute(strSql)

May be this can help others also...
<


Edited by - beso on 21 October 2002 11:59:59
Go to Top of Page

beso
New Member

Finland
63 Posts

Posted - 21 October 2002 :  12:03:16  Show Profile  Visit beso's Homepage
quote:
Originally posted by LeoRat
Beso - I had Russian also working at i2Asia before (currently disabled). Anyway, I setup a link for you. Please check it at i2Asia.



Thank you LeoRat, your experience is very important <

Go to Top of Page

n/a
deleted

593 Posts

Posted - 21 October 2002 :  15:18:31  Show Profile
I find your above "unicode fix" quite informative. Thanks.

<

Taku
Go to Top of Page

beso
New Member

Finland
63 Posts

Posted - 21 October 2002 :  17:48:16  Show Profile  Visit beso's Homepage
quote:
Originally posted by LeoRat

I find your above "unicode fix" quite informative. Thanks.


But, till, for me it is secret how yours forum is working unicode...,
so perfectly... I have tested all possible variants...

Plz. login with unicode name and check cookie: what is written there?

One more respect may be is that Georgian have not CODEPAGE -- but only unicode. Are languages you use for your forum having codepages?<

Edited by - beso on 21 October 2002 17:56:28
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 21 October 2002 :  18:34:51  Show Profile
quote:

One more respect may be is that Georgian have not CODEPAGE -- but only unicode. Are languages you use for your forum having codepages?


There are languages that do not codepage (Armenian, Georgian, Hindi, Tamil, Marathi, Sanskrit & Konkani).

But your LCID is known it is hex 0437...

I actually don't know how to approach this case although I'd like to do... All of these languages are important to support. How do you solve the problem in Windows systems? With special designed fonts like we had in Turkish a couple of years ago?
<

Stop the WAR!
Go to Top of Page

n/a
deleted

593 Posts

Posted - 21 October 2002 :  19:44:04  Show Profile
Yes, all languages used at i2Asia have its defined codepage - but ISO definitions and Windows definitions of Codepages do not necessary match for some languages.
LCID wise, you can check all the existing language LCID codes in
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=25195 (Start Internationalization Here...) and Bozden has a full list of MS NLS somewhere...which identifies all those.

LCID and encoding systems are not necessarily one to one mapping.
LCID is more a regional/locational id and encoding is a type of characterset format used.... As you know, unicode (name indicates "uni" = a single charset system for all languages) uses a single charset system for all and there is CJK unicode charsets and assume they have Georgian charsets - I know there is a Russian charset groups in there..... If you go through Int'l Dev forum, you will find detailed discussions and explanations by Bozden and others on these..

Part of reasons that unicode is used at i2Asia is, besides multilingual contents to be rendered in a single page (simultaneous representation, rather than having some charsets showing corrupted, depending on a choice of encoding scheme), is to allow a language selector locale language description to be in a locale language itself and also allows login name input can be done with a local language representation. (I personally don't like pwd to be in locale, so I don't know about that part...)

ASP Hosting is with Brinkster, which is powered by Windows 2000, using Access 2000 db (which comes with Snitz), and forum language files are all in utf-8 formats, and unicode (UTF-8) content type defined in inc_top.asp. No special formatting/settings on source codes (VBscripts, etc.) which are processed on a server side (meaning, all forum files except the langNNNN.asp is really saved/formatted in UTF8..... This is again only about this particular environment and cannot really say about other settings.

I believe the exotic language groups mentioned above can be represented in unicode... I saw one in Hindi somewhere and obviously Georgian is working as well according to your comments.

V4.4 under development right now, according to Bozden's status notes, really address all these issues and beyond in enabling
Snitz Forum handling "globalization" issues....which represents a major enhancement in scalability of program codes to address core internationalization/globalization requirements for the forum...
So, I assume many of the issues including the one we are discussing here will be addressed in upcoming V4.4

Hope all works well for you.




<

Taku
Go to Top of Page

beso
New Member

Finland
63 Posts

Posted - 22 October 2002 :  20:01:22  Show Profile  Visit beso's Homepage
quote:
Originally posted by bozden
How do you solve the problem in Windows systems? With special designed fonts like we had in Turkish a couple of years ago?



Windows 2000 and XP (Office 2000 and XP) are supplied with Unicode fonts "Arial Unicode MS" and "Sylfaen" where Georgian is represented. Also, there are some nice home made unicode fonts.

LCID hex/dec Language Locale
0x409/1033 English English (United States)
0x437/1079 Georgian Georgian
0x41f/1055 Turkish Turkish

For Georgian I am using for SnitzForums "1079", but is LCID helpful for encoding/decoding of non codepaged languages?

As I have checked all nonASCII/ANSI simbols (and some others) are automatically written into cookies as server.URLencoded(?) -- but it happens error when pure unicode simbols are written...

Working over 3 years with Georgian Unicode in ASP/VB environment I have not met any other seriouz problem, exept cookies (not only using Snitz application, but other applications al well).<

Edited by - beso on 22 October 2002 20:42:35
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 22 October 2002 :  20:51:26  Show Profile
Does this mean that you also had Cookie related problems in other software as well?

Did you try to write a simple code to write and read back some unicode data in Georgian?
<

Stop the WAR!
Go to Top of Page

beso
New Member

Finland
63 Posts

Posted - 23 October 2002 :  07:14:58  Show Profile  Visit beso's Homepage
quote:
Originally posted by bozden

Does this mean that you also had Cookie related problems in other software as well?
Did you try to write a simple code to write and read back some unicode data in Georgian?



Yes, cookie problem is general an is not related on application.
Small script writing/reading Geogrian Unicode cookie is here:
http://www.qseli.com/test_cookie.asp
instead of Georgian cookie is responding "???????"<

Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 23 October 2002 :  09:43:44  Show Profile
Well, it was a very nicely prepared page . I spent a lot of time for testing and searching (Google & MSKB) with no success.

Your encode/decode functions DO work (I tested it localy using utf-8 encoded ASP file and fixed strings).

The only thing I found related is that it is also done similarly in a Vietnamese installation: http://www.dactrung.com/hochoi/unicodeforum.asp , not related to cookies but to match the input method to the database.

And you are right, there are hundreds of cookie calls around...
<

Stop the WAR!
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 Forum Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000 Version 3.4.07