Link to home
Start Free TrialLog in
Avatar of arielbf
arielbfFlag for Israel

asked on

db results not fully dispplayed

I have something like this:

<textarea rows="6" cols="50" name="myVar"><%=rs("myVar")%></textarea>

In the DB i see that myVar contains the full text (which is 168 characters lenght) and for some reason when displayed on my browser it displays only the first 110 characters of the field...  any ideas about it?
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

>>when displayed on my browser it displays only the first 110 characters of the field...

is that your content contains chars such as "<" and ">" ? is seems that you didn't encode the content before display it in the textarea...
If you "View Source" the page when it is loaded is the full content there, or just the 110 characters? That will tell you if it is simply a display issue, or if there's an issue pulling from the database.
Avatar of arielbf

ASKER

I had some of those.,, I tried to remove them without any change.

However when in the DB i've changed the datatype to text instead of varchar(200) - the field was displayed correctly. However i still should be able to present the text when the field is varchar - my field is set to accept 200 chars - and in the db I see the full text...
try

<textarea rows="6" cols="50" name="myVar"><%=Server.HTMLEncode( rs("myVar") )%></textarea>

if that doesnt work, can you post the actual data that is supposed to be displayed?
Avatar of arielbf

ASKER

well, aparently it partially works - but the problem now is that instead of normal text i see giberish....
even when i do something like this:
<%response.codepage=0%><%=Server.HTMLEncode(rs("myVar"))%><%response.codepage=65001%>
try it without the request.codepage statements.

also, please post the actual data like I asked previously
Avatar of arielbf

ASKER

even without the request.codepage this is not helping.

The original text is in hebrew - If I change it to english - the problem disappears and the full text is diplayed correctly.

as you requested -
now the code is:
 <textarea rows="6" cols="50" name="myVar"><%=Server.HTMLEncode( rs("myVar") )%></textarea>

in the db (this is in hebrew):
נמוכה, בדרך כלל את לא דוחה ביצוע משימות ומטלות קשות או לא נעימות, במיוחד אם הן הכרחיות וחשובות. את מקפידה לעמוד בלוחות זמנים שאת הצבת לעצמך או אחרים הציבו לך.

the output in the browser:
× ×ž×•×›×”, בדרך כלל את לא דוחה ביצוע משימות ומטלות קשות או לא × ×¢×™×ž×•×ª, במיוחד אם הן הכרחיות וחשובות. את מקפידה לעמוד

if the code is:
 <textarea rows="6" cols="50" name="myVar"><%=rs("myVar") %></textarea>

then the output in the browser is:
נמוכה, בדרך כלל את לא דוחה ביצוע משימות ומטלות קשות או לא נעימות, במיוחד אם הן הכרחיות וחשובות. את מקפידה לעמוד
you probably need to set the charset of your page to display unicode chars
what database are you using? I try to simulate the scenario...
Avatar of arielbf

ASKER

The charset is set to utf-8 in every place possible.
Ryan is absolutely correct hear (thus the reason to pay closer attention to experts when they ask you for something), you need to encode these special characters. Remove the HTMLEncode function and make sure you have your CodePage property set like:

<%@Language="VBScript" CodePage = 65001 %>
Avatar of arielbf

ASKER

the page has the
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
setted - without succes - the hebrew is now displayed correctly but the line is still short
can you try hard coding the data in the textarea and see if that works. That way we can narrow down the list of possible issues.
ASKER CERTIFIED SOLUTION
Avatar of arielbf
arielbf
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>since my workaround (eg. changing the db column to 'text' instead of 'varchar')  is working - I will accept it as my solution for the moment.

I don't think by changing the data type it will solved the initial issue of displayed less chars as expected since you claimed that your field is accepting up to 200 chars while it only displayed first 110 chars.

it could be other reason why your web page is behaved like this.
Avatar of arielbf

ASKER

Well, it may help - I didn't mention it at the beginning, since I wasn't sure that was the issue:
The all problem started when I've moved my website from a windows2003 server to windows2012.
Maybe it has something to do with IIS configurations.... But i'm cluless about it :(
Avatar of arielbf

ASKER

The solution is not ideal - but it is the only idea that works.