sitelink1 | http://www.javapractices.com/topic/TopicAction.do?Id=96 |
---|---|
sitelink2 | |
sitelink3 | |
sitelink4 | |
sitelink5 | |
sitelink6 |
위 character들은 사용되는 언어에 따라 특수처리 되는 경우가 있다.
가령 '<' 는 < 로 변환 처리되어야 한다.
이것은 HTML, XML, RegEx 등등 각각의 언어에 따라 다르게 설정되기도 한다
다음은 원문
- <
- >
- "
- '
- &
- Arbitrary text placed in an HTML tag often needs to be altered, to ensure that the resulting HTML remains valid.
Problem characters can include
These characters can be replaced with HTML character entities. For example, < can be replaced with <.
Query strings (Blah=1&Name=Bob) often need to be escaped as well. If the query string contains special characters, it will need to be "URL encoded". (See the javadoc for the URLEncoder class for further information.) This will ensure the query string conforms with valid HTTP.
There is often a second issue, however, with regard to query strings. If a query string is placed in an HREF attribute, then even a URL encoded query string is often not of valid form. This is because URLEncoder produces valid HTTP, but it does not in general produce text which is a valid HTML attribute - the ampersand character needs to be replaced by the corresponding character entity &.
Here is an example of a utility class which escapes special characters for HTML, XML, regular expressions, and so on.
- <
- >
- "
- '
- &