Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 11th, 2003, 06:13 PM
stuie stuie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Brisbane, Australia
Posts: 38 stuie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 52 sec
Reputation Power: 7
Funny Characters

Hello,

I've got a problem... I can't really determine where it lies but this is what's happening. It's with a shopping system.

I've got an "Add New Product" form that's parsing to a ASP script. When I paste a ¼ into the textbox it's all fine but when I paste into a textarea it looks okay, but when I look at the product it's converted it to &amp#184; but the textbox instance of ¼ looks fine.

Any ideas?

Thanks

Reply With Quote
  #2  
Old November 11th, 2003, 07:05 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
That was supposed to happen. Characters that can't be entered via the keyboard in a usual manner are assigned these special codes. A quick example would be the copyright symbol (©), which is ©

More info: http://www.utexas.edu/learn/html/spchar.html

Reply With Quote
  #3  
Old November 11th, 2003, 07:38 PM
stuie stuie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Brisbane, Australia
Posts: 38 stuie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 52 sec
Reputation Power: 7
but it's not...

Hello,

I understand this but it's like it's not escaping them, and its actually displaying the &amp#184; and not the 1/4 symbol.

Thanks,

Reply With Quote
  #4  
Old November 11th, 2003, 08:10 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Sounds like the ampersand symbol is being escaped out to "&" - instead of just the actual character. Check the source, that'll tell you.

Reply With Quote
  #5  
Old November 11th, 2003, 08:46 PM
stuie stuie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Brisbane, Australia
Posts: 38 stuie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 52 sec
Reputation Power: 7
That's what's happening... any idea why?

Thanks.

Reply With Quote
  #6  
Old November 11th, 2003, 08:52 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Are you running any escaping functions on your strings (e.g. server.urlencode)? It sounds like it's being escaped twice. The first time it's probably happening automatically when you paste from MS Word. If you run an escape function over the string, then that's what would cause the problem.

Reply With Quote
  #7  
Old November 11th, 2003, 09:48 PM
stuie stuie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Brisbane, Australia
Posts: 38 stuie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 52 sec
Reputation Power: 7
Cheers mate, I've found the problem, to correct I need a method in ASP that does the same thing as PHP's nl2br().

Does anyone know?

Thanks again.

Reply With Quote
  #8  
Old December 11th, 2003, 08:08 AM
hagur hagur is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Iceland
Posts: 11 hagur User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
There's no built in equivalent to PHP's nlc2br.

However, you can make your own:


function nl2br(sInput)
nl2br = replace(sInput,vbCrLf,"<br/>")
end function


Usage:

content = nl2br(content)


Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Funny Characters


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT