Special character
Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Rich Text Editor (RTE)
Forum Description: Support forum for the Web Wiz Rich Text Editor (RTE).
URL: https://forums.webwiz.net/forum_posts.asp?TID=18374
Printed Date: 29 March 2026 at 12:33pm Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: Special character
Posted By: Marcvanu
Subject: Special character
Date Posted: 13 February 2006 at 2:00pm
I have a small problem when writing in french. The character ASCII 39 is coorupting the javascript code. How could I by pass the problem ?
------------- Mvu
Brussels
|
Replies:
Posted By: WebWiz-Bruce
Date Posted: 13 February 2006 at 2:03pm
Could you please give more detail, such as the javascript error and when it happens
------------- 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: Marcvanu
Date Posted: 13 February 2006 at 2:22pm
I do not get an error. Actually when the code is uploaded into my Access database, all the characters following the famous character (I do not type it here) ASCII 39 is not taken neither the characters ASCII 39 itself. I know that this character is used in Javacsript language and I suscpect this is the cause of the problem.
------------- Mvu
Brussels
|
Posted By: WebWiz-Bruce
Date Posted: 13 February 2006 at 2:55pm
Javascript would not be the issue here.
It sounds more like a browser encoding issue.
Try changing the page encoding for the RTE and see if that fixes the issue. You should file a file called 'browser_page_encoding_inc.asp' that shopuld help you do this.
------------- 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: Marcvanu
Date Posted: 13 February 2006 at 3:19pm
|
Well, I am not sure because if I uncomment Western European ISO or Unicode UTF-8 it does not change anything. But I realised that if I type twice teh famous character, one is saved not the second one. Here is an example in french:
L'exemple, it will return in the RTE_editor this L
If I write
L''exemple, it will return L'exemple and that is correct.
Strange...
------------- Mvu
Brussels
|
Posted By: WebWiz-Bruce
Date Posted: 13 February 2006 at 3:31pm
If you type an example into the demo RTE with the ' in it, then it works without any issues.
This then suggests that the issue is with your code.
If you are saving to a database the character ' in SQL means the end of a string.
To prevent SQL injections from hackers and to stop this issue if you are using an SQL INSERT statement then you need to escape the quote character by replacing it with 2 quotes ''
input = Replace(input, "'", "''", 1, -1, 1)
|
------------- 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: Marcvanu
Date Posted: 13 February 2006 at 3:52pm
|
Actually, in my scripts I use the following function:
function formatForDb(input) dim tempStr tempStr=input if isNull(tempStr)=false then ' replace to avoid DB errors tempStr = replace(tempStr,"/"," ") tempStr = replace(tempStr,"'","''") tempStr = replace(tempStr,"''''","''") tempStr = replace(tempStr,"''''''","''") tempStr = replace(tempStr,"''''''''","''") tempStr = replace(tempStr,"""","""") end if formatForDb = tempStr end function
It works fine in my other forms. Therefore my surprise here because I thought it should also work wthe RTE.
I don't understand why.
------------- Mvu
Brussels
|
Posted By: WebWiz-Bruce
Date Posted: 13 February 2006 at 4:22pm
The only line of any use in that lot is:-
tempStr = replace(tempStr,"'","''") |
The rest won't do a thing to help with your SQL.
Here's a better one that I have refined over the years:-
'Format SQL Query funtion Private Function formatSQLInput(ByVal strInputEntry)
'Remove malisous charcters from sql strInputEntry = Replace(strInputEntry, """", "", 1, -1, 1) strInputEntry = Replace(strInputEntry, "'", "''", 1, -1, 1) strInputEntry = Replace(strInputEntry, "[", "[", 1, -1, 1) strInputEntry = Replace(strInputEntry, "]", "]", 1, -1, 1)
'Return formatSQLInput = strInputEntry End Function |
------------- 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: Marcvanu
Date Posted: 14 February 2006 at 9:14am
Well, I am afraid this is not the problem. Do you have among your "customers" people running RTE in french ?
------------- Mvu
Brussels
|
Posted By: WebWiz-Bruce
Date Posted: 14 February 2006 at 11:35am
There maybe, but I can't see how this is an issue within the RTE as you can use quotes (') in this forum which uses the RTE and in the demo version without any issues and is a common used character in most languages.
This suggests that the issue is within your code that saves to the database.
For a quick work around just use:-
strInputEntry = Replace(strInputEntry, "'", "'", 1, -1, 1)
------------- 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: Marcvanu
Date Posted: 14 February 2006 at 1:17pm
I agree with you, but what is strange is that on other forms, using exactly the same script to update de DB, I do not have the problem. I will look at that and if I find the reason, I will let you know.
------------- Mvu
Brussels
|
Posted By: Marcvanu
Date Posted: 14 February 2006 at 4:28pm
|
Ok, I found the the problem.
I wrote in the script myVariable = request.form("textarea")
but I have another script running the stringFunctions.
This scripts requires to write myVariable== getUserInput(request.form("textarea"),10000)
------------- Mvu
Brussels
|
Posted By: WebWiz-Bruce
Date Posted: 16 February 2006 at 10:05am
Glad you found the course of this problem.
------------- 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
|
|