UTF-8 - MemberAPI and more
Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=26110
Printed Date: 03 April 2026 at 1:41am Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: UTF-8 - MemberAPI and more
Posted By: efscl
Subject: UTF-8 - MemberAPI and more
Date Posted: 14 August 2008 at 4:11pm
Hi together,
long time ago - but i am still here with a new question.
Installed and using WWF in version 9.05 with member API. No probs so far. But know we also have chinese and other foreign languages on board.
1.) In the member API the authentification is going through the existing Sessions we have (USERNAME and PASSWORD). When the user is coming the first time to the forum - a new author will be created. The username session variable we show up at the page (header.asp) already on an other position - thats ok. But by creating a new user in tblAuthor the username will be stored like this:
和平Name = ??NameSo - the value of the session is utf-8 - but this will not going into the tblAuthor auf wwf. Any Help around?
2.) Topics are stored as UTF-8 but the message content not. Is "text" also utf-8 like nvarchat(xyz) for MS-SQL Server? (we use 2005)
(I went through the release notes to check if there where some utf-8 related updates. Did not found them).
OK - would be nice if somebody can have a look on it. Sebastian
UPDATE/Add. information: Yes, in setup_options_in.asp i have Const strPageEncoding = "utf-8"
------------- -----
http://www.belodged.com - belodged.com - Worldwide accommodations for free
|
Replies:
Posted By: efscl
Date Posted: 02 September 2008 at 9:30am
Sorry - if i ask again. Any hints/advices around?
thank you very much Sebastian
------------- -----
http://www.belodged.com - belodged.com - Worldwide accommodations for free
|
Posted By: WebWiz-Bruce
Date Posted: 02 September 2008 at 11:09am
Try changing the LCID locale for the ASP pages. See the following page for more info:-
http://www.webwiz.net/kb/asp_knowledgebase/date_time_settings.asp - http://www.webwiz.net/kb/asp_knowledgebase/date_time_settings.asp
The reason text is used and not nText is for backward compatibility with previous versions. When the SQL Server version was introduced most web hosts used SQL Server version 7 which didn't support nText or nvarchar. If it were to be changed now it would break all those upgrading from previous releases. Not using nText and nvarchar shouldn't make any difference though and would not stop the forum from running.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: efscl
Date Posted: 02 September 2008 at 11:40am
Hi Bruce,
thank you for your feedback. "text/ntext" i ok for me.
But i can not work with LCID other than uft-8 because of we have user from great britian and users from china using the same forums.
Thing is that storing the subject of the message is ok! but the username and message body is not working as utf-8.
We using member API and the session is stored in UTF-8 Format. This one is working. But a chinese username will not be stored correctly in the forum database when the user is coming to the forum via the member API.
Any other ideas? only the username and message body has the problem. Subject of a post is working great.
thx for the great app and best regards Sebastian
------------- -----
http://www.belodged.com - belodged.com - Worldwide accommodations for free
|
Posted By: WebWiz-Bruce
Date Posted: 02 September 2008 at 11:59am
Sorry I don't have any other suggests for this type of multiple language/character set setup.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: efscl
Date Posted: 02 September 2008 at 1:08pm
thanks anyway - i will try to solve this for myself. Message of a new topic is already working. This is what i have done:
Process is like this: new_topic_form.asp => Form to new_post.asp => line 151 - still UTF-8 => line 395 - still UTF-8 => line 519 - still UTF-8 => line 792 - still UTF-8
- so it must be on the database or the sql statement.
Action: Changed for "message" table "tblThread" the data type from old: text to new: ntext
Result: Message of a new topic will be stored correctly as utf-8 ! 
Will keep you upToDate with the memberAPI. (username is not going as utf-8 into the database.
regards Sebastian
------------- -----
http://www.belodged.com - belodged.com - Worldwide accommodations for free
|
Posted By: efscl
Date Posted: 02 September 2008 at 3:50pm
Hi Bruce,
found the reason - but do not know the solution:
in functions/functions_member_API.asp we added at line 393 (after executing the sql-insert statement for a new user) an response.write strSQL and a response.end()
Result:
- the page is showing up as an UTF-8 page
- The SQL Statement is correct like ".... 和平Techi ..." (value of the strUsername)
- but in the database the value of the username results in an "??Techi"
Any idea? Im testing further....
------------- -----
http://www.belodged.com - belodged.com - Worldwide accommodations for free
|
Posted By: WebWiz-Bruce
Date Posted: 02 September 2008 at 5:46pm
The file uses an SQL INSERT query, maybe try using ADO to insert the data into the database.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: efscl
Date Posted: 03 September 2008 at 12:35pm
Yep - great idea - will test it and give you an update soon.
best regards Sebastian
------------- -----
http://www.belodged.com - belodged.com - Worldwide accommodations for free
|
Posted By: efscl
Date Posted: 02 December 2008 at 11:52am
Hi Bruce,
long time i did not visited your forums.
But the problem was existing all the time. Today it was the day to take a look again on my problem. Finally i got it. Do not ask me for the reason. But the plain SQL Statements in memberAPI you are using with ADODB.Connection do not transfer the username / values as UTF-8 (Windows Server 2003, SQL Server 2005, using OLEDB). As described above i tried a lot.
Solution: I used for the memberAPI instead of the plain SQL really stored procedures.
First i tried
strSQL = "exec NameOfProcedure '" & strUsername & ",;".
Did not work. i got no result. strUsername was passed as none UTF-8.
But with calling the stored procedure like:
RSApi__Username = strUsername Set RSApi_cmd = Server.CreateObject ("ADODB.Command") RSApi_cmd.ActiveConnection = dbconnectionstring RSApi_cmd.CommandText = "{call dbo.proc_NAMEOFPROCEDURE(?)}" RSApi_cmd.Prepared = true RSApi_cmd.Parameters.Append RSApi_cmd.CreateParameter("param1", 202, 1, 30, RSApi__Username) Set rsCommon = RSApi_cmd.Execute RSApi_numRows = 0
the Username was given to the DB as UTF-8.
This i had to do with the looking for existing user and adding a new user. And i used it for the Update Statement on Author table within the memberApi too.
But then i had the problem again with the userCode / strUserCoder. And there is my last question: Is there a reason (i have to take care of why you are using the username in the usercode) too? In function usercode you have
strUserCode = strUsername & hexValue(10)
Then you use strUserCode often in WHERE Statements for the whole app. But there i end up in the same problem. The strUserCode had UTF-8 characters which where not working with ALL the where statements in plain SQL. I do not wanna to rebuild the whole application with stored procedures.
So im using now only the hexValue and not the Username anymore in the strUserCode. Question again: Do i get there into trouble which i do not see right now?
As i thought - it will now be complicater more and more to follow the updates (thanks for the work!). But this is my problem  Maybe would be a great idea to mark security updates in the release notes in red color. So i better see on which ones i have to take a eye on.
Thank you very much for the great app. And sorry again for my bad english. best regards and best wishes Sebastian
------------- -----
http://www.belodged.com - belodged.com - Worldwide accommodations for free
|
|