|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 ¸ but the textbox instance of ¼ looks fine. Any ideas? Thanks |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
|||
|
|||
|
but it's not...
Hello,
I understand this but it's like it's not escaping them, and its actually displaying the ¸ and not the 1/4 symbol. Thanks, |
|
#4
|
||||
|
||||
|
Sounds like the ampersand symbol is being escaped out to "&" - instead of just the actual character. Check the source, that'll tell you.
|
|
#5
|
|||
|
|||
|
That's what's happening... any idea why?
Thanks. |
|
#6
|
||||
|
||||
|
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.
|
|
#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. |
|
#8
|
|||
|
|||
|
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) ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > Funny Characters |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|