Skip to main content
gamedev.net
🔒 Locked

HTML characters

Started by Anima 5 replies 650+ views
Original Post
Anima
Anima
I'm writing a HTML-based Log class and am now writing a function to convert special characters into HTML format (e.g. changing '<' to '& lt' and & to '& amp'). So far I've determined that the greater than, less than, and ampersand characters requires this conversion (unless there is a better way?). Can someone tell me which other characters I will need to convert in this way? [edited by - Anima on June 11, 2004 10:32:40 AM]
Shadowdancer
Shadowdancer
Those characters are pretty much all you need to convert as for control characters. However, you''ll want to convert high-ASCII characters to their respective HTML entities (usually just &#<ASCII-code> if you are not using some Unicode encoding.
Koroljov
Koroljov
quote:
Original post by Pipo DeClown
You can display the text in a, ready-only and styled TEXTAREA.

<textarea class='myCSSclass' READONLY='READONLY'></textarea>   


--
You're Welcome,
Rick Wong
- Google | Google for GameDev.net | GameDev.net's DirectX FAQ. (not as cool as the Graphics and Theory FAQ)



Don't do that. No DONT.
Exaple: <textarea> Some text with a < in it. </textarea>

Internet explorer can propably interpret this correctly. But it isn't correct.
What does a less intelligent browser think about this?
"<textarea>" is a tag
"Some text with a" is not a tag
"< in it. </textarea>" is a tag



[edited by - koroljov on June 11, 2004 12:29:09 PM]
Why do my programs never work on other computers?
leiavoia
leiavoia
There are libs that will convert html in a number of ways. If nothing else, you might look into a Perl module and small program, and call that externally from your main program.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.