unbescape-unbescape-1.1.5.RELEASE/ 0000775 0000000 0000000 00000000000 13114102336 0016477 5 ustar 00root root 0000000 0000000 unbescape-unbescape-1.1.5.RELEASE/.gitattributes 0000664 0000000 0000000 00000001517 13114102336 0021376 0 ustar 00root root 0000000 0000000 # Auto detect text files and perform LF normalization
* text=auto
*.java text diff=java
*.properties text
*.js text
*.css text
*.less text
*.html text diff=html
*.jsp text diff=html
*.jspx text diff=html
*.tag text diff=html
*.tagx text diff=html
*.tld text
*.xml text
*.gradle text
*.sql text
*.xsd text
*.dtd text
*.mod text
*.ent text
*.txt text
*.md text
*.markdown text
*.thtest text
*.thindex text
*.common text
*.odt binary
*.pdf binary
*.sh text eol=lf
*.bat text eol=crlf
*.ico binary
*.png binary
*.svg binary
*.woff binary
*.rar binary
*.zargo binary
*.zip binary
CNAME text
*.MF text
unbescape-unbescape-1.1.5.RELEASE/.gitignore 0000664 0000000 0000000 00000000072 13114102336 0020466 0 ustar 00root root 0000000 0000000 .classpath
.project
target/
bin/
.settings/
.idea/
*.iml
unbescape-unbescape-1.1.5.RELEASE/BUILD.txt 0000664 0000000 0000000 00000001365 13114102336 0020104 0 ustar 00root root 0000000 0000000
Building unbescape
------------------
To build unbescape you will need Maven 2. You can get it at:
http://maven.apache.org
Build and install the project executing, from the unbescape
project root folder:
mvn clean:clean install
And you will get a fresh target/unbescape-{version}.jar file.
You will also get it installed in your local repository at:
$M2_REPO/org/unbescape/unbescape/{version}/unbescape-{version}.jar
Generating Javadoc for unbescape
--------------------------------
If you wish to generate the javadoc for unbescape, execute this from the
unbescape root folder:
mvn javadoc:javadoc
This will generate the javadoc documentation in HTML format in:
target/site/apidocs
unbescape-unbescape-1.1.5.RELEASE/CONTRIBUTING.markdown 0000664 0000000 0000000 00000034233 13114102336 0022157 0 ustar 00root root 0000000 0000000 Contributing to Unbescape: Terms and Conditions
===============================================
------------------------------------------------------------------------------
Do you want to contribute your work to Unbescape? Well, then first and most important: **THANK YOU!**
Now, in order to accept your contribution, there are some terms you must expressly agree with, so please
read them carefully. They might look a bit cumbersome, but they are here just in order to protect
you, your contribution, and especially the project's future.
**Important**: submitting any contributions to the Unbescape project implies your **full acceptance of these terms**,
including the *"Unbescape Individual Contributor License Agreement"* detailed at the end.
Who can contribute?
-------------------
Anyone, with the unique condition that he/she must be a **private individual**, acting in
his/her own name, and not being endorsed in their contributed work by any company or government.
Note that this condition will not only refer to the ownership of the effort invested in contributing
to the project, but also to the fact that *no private or public company will be mentioned as a a part
of your contribution on the project's website or code*, including but not limited to web/email addresses
or package names.
What is the first step to be taken?
-----------------------------------
First of all, **talk to the [project members](http://www.unbescape.org/team.html)** (an email should do) about
your ideas: new features, fixes, documentation... whatever you would like to contribute to the project. Let we
discuss the possibilities with you so that we make sure your contribution goes in the right direction and aligns
with the project's standards, intentions and roadmap.
How will your relation with the Unbescape project be?
-----------------------------------------------------
Your contributions will have the form of GitHub *pull requests*. Note that contributors do not
have read+write (or *pull+push*) access to the project repositories, only project *members* do.
Also, please understand that *not all pull requests will be accepted and merged into the project's
repositories*. Talking about your planned contributions with the project members before creating pull requests
will maximize the possibilities of your contributions being accepted.
Once your contribution is approved, you will be listed as a *contributor* at the
[Unbescape Team page](http://www.unbescape.org/team.html). You can opt-out of this if you want.
Also, you will be `@author` for any new Java classes that you write and also co-`@author` to any existing classes to
which you make significant changes. You can also opt-out of this if you want.
About the code you contribute
-----------------------------
### General guidelines:
- Obviously, **your code must both compile and work correctly**. Also, the addition of any new patches to the
codebase should not render it unstable in any way.
- All your code should be easy to read and understand by a human.
- There should be no compilation warnings at all.
### Detailed Java code quality standards:
- All your code should compile and run in **Java 5.0**.
- All comments, names of classes and variables, log messages, etc. must be **in English**.
- All `.java` files must include the standard Unbescape copyright header.
- All your code should follow the Java Code Conventions regarding variable/method/class naming.
- Maximum line size is 120 characters.
- Indentation should be made with 4 spaces, not tabs.
- All .java source files should be pure ASCII. All .properties files should be ISO-8859-1.
- Number autoboxing and/or autounboxing is forbidden.
- Every class should define a constructor, even if it is the default one, and include a call to `super()`.
- Every non-nullable argument in a public method should be first validated with a `Validate.notNull(...)` call.
- All method arguments should include the `final` modifier, so that their value is never changed.
- Include `/* ... */` comments for every algorithm you develop with a minimum of complexity. *"Minimum
of complexity"* usually means you had to take some design decisions in order to write it the way you did. Do
not write obvious comments.
- All public methods and classes directly available to users (i.e. public) should have comprehensive javadoc.
### Detailed HTML/XML code quality standards:
- All tags, CSS styles, file names, etc. must be **in English**.
- Lower case should be prefered for HTML/XML artifacts. The only exceptions are `DOCTYPE` and `CDATA` clauses.
- All HTML code should be XML-valid (i.e. all tags should be closed, attributes surrounded by commas, etc.)
- Maximum line size is 120 characters.
- Indentation should be made with 4 spaces, not tabs.
- Line feeds should be UNIX-like (`\n`).
- All .html and .xml source files should be pure ASCII, even if _content-type_ is set to a different encoding.
- All XHTML self-closing (minimized) tags should have a space before `/>` (the XHTML standards say so!).
- All inline scripts must be enclosed inside a commented `` block.
About the documentation/articles you contribute
-----------------------------------------------
Note the following only applies to documentation/articles meant to be published at the Unbescape website.
- All documentation artifacts, including articles, must be written **in correct English**.
- Your name and email will be displayed as *"author"* of any documentation artifacts you create.
- Topic and text structure must be first discussed and agreed upon with the project members.
- Project members may edit and make small changes to your texts --of which you will be informed-- before
publishing them.
- Format and visual styles must adhere to the Unbescape website standards, of which you will be informed
by the project members.
Pay special attention to this
-----------------------------
All Unbescape software is distributed under the **Apache License 2.0** open source license, and your contributions
will be licensed in the same way.
If you work for a company which, by the way or place in which your code was written, by your contract terms
or by the laws in your country, could claim any rights (including but not limited to intellectual or industrial
property) over your contributed code, you will have to send the project members (either by email from your
authorised superiors or by signed fax), a statement indicating that your company agrees with the terms
explained in this page, and that it both authorises your contribution to Unbescape and states that will
never claim any kind of rights over it.
Unbescape Individual Contributor License Agreement
---------------------------------------------------
This contributor agreement ("Agreement") documents the rights granted by contributors to the Unbescape Project.
This is a legally binding document, so please read it carefully before agreeing to it. The Agreement
may cover more than one software project managed by Unbescape.
###1. Definitions
* _"Unbescape"_ means the "Unbescape Project organization and members".
* _"You"_ means the individual who submits a Contribution to Unbescape.
* _"Contribution"_ means any work of authorship that is submitted by you to Unbescape in which you own
or assert ownership of the Copyright.
* _"Copyright"_ means all rights protecting works of authorship owned or controlled by you,
including copyright, moral and neighboring rights, as appropriate, for the full term of their
existence including any extensions by you.
* _"Material"_ means the work of authorship which is made available by Unbescape to third parties. When
this Agreement covers more than one software project, the Material means the work of authorship
to which the Contribution was submitted. After you submit the Contribution, it may be included
in the Material.
* _"Submit"_ means any form of electronic, verbal, or written communication sent to Unbescape or its
representatives, including but not limited to electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, Unbescape for the purpose of discussing
and improving the Material, but excluding communication that is conspicuously marked or
otherwise designated in writing by you as _"Not a Contribution."
* _"Submission Date"_ means the date on which you submit a Contribution to Unbescape.
* _"Effective Date"_ means the date you execute this agreement or the date You first submit a
Contribution to Unbescape, whichever is earlier.
###2. Grant of Rights
####2.1. Copyright License
* (a) You retain ownership of the copyright in your Contribution and have the same rights to use or
license the Contribution which you would have had without entering into the agreement.
* (b) To the maximum extent permitted by the relevant law, you grant to Unbescape a perpetual, worldwide,
non-exclusive, transferable, royalty-free, irrevocable license under the copyright covering the
Contribution, with the right to sublicense such rights through multiple tiers of sublicensees, to
reproduce, modify, display, perform and distribute the Contribution as part of the Material; provided
that this license is conditioned upon compliance with Section 2.3.
####2.2 Patent License
For patent claims including, without limitation, method, process, and apparatus claims which you
own, control or have the right to grant, now or in the future, you grant to Unbescape a perpetual, worldwide,
non-exclusive, transferable, royalty-free, irrevocable patent license, with the right to sublicense these
rights to multiple tiers of sublicensees, to make, have made, use, sell, offer for sale, import and
otherwise transfer the Contribution and the Contribution in combination with the Material (and
portions of such combination). This license is granted only to the extent that the exercise of the
licensed rights infringes such patent claims; and provided that this license is conditioned upon
compliance with Section 2.3.
####2.3 Outbound License
As a condition on the grant of rights in Sections 2.1 and 2.2, Unbescape agrees to license the Contribution only
under the terms of the Apache License 2.0 (including any right to adopt any future version of this license if
permitted).
####2.4 Moral Rights
If moral rights apply to the Contribution, to the maximum extent permitted by law, you waive and agree not
to assert such moral rights against Unbescape or its successors in interest, or any of our licensees, either
direct or indirect.
####2.5 Unbescape Rights
You acknowledge that Unbescape is not obligated to use your Contribution as part of the
Material and may decide to include any Contributions Unbescape considers appropriate.
####2.6 Reservation of Rights
Any rights not expressly assigned or licensed under this section are expressly reserved by you.
###3. Agreement
You confirm that:
* (a) You have the legal authority to enter into this Agreement.
* (b) You own the Copyright and patent claims covering the Contribution which are required to grant
the rights under Section 2.
* (c) The grant of rights under Section 2 does not violate any grant of rights which you have made to
third parties, including your employer. If you are an employee, you have had your employer approve
this Agreement. If you are less than eighteen years old, please have your parents or guardian
sign the Agreement.
###4. Disclaimer
EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS PROVIDED "AS IS". MORE PARTICULARLY,
ALL EXPRESS OR IMPLIED WARRANTIES INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO UNBESCAPE AND BY
UNBESCAPE TO YOU. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY IS LIMITED IN
DURATION TO THE MINIMUM PERIOD PERMITTED BY LAW.
###5. Consequential Damage Waiver
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU OR UNBESCAPE BE LIABLE FOR ANY LOSS OF
PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY
DAMAGES ARISING OUT OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT OR OTHERWISE)
UPON WHICH THE CLAIM IS BASED.
###6. Miscellaneous
* 6.1 This Agreement will be governed by and construed in accordance with the laws of Spain excluding its
conflicts of law provisions. Under certain circumstances, the governing law in this section might be
superseded by the United Nations Convention on Contracts for the International Sale of Goods ("UN
Convention") and the parties intend to avoid the application of the UN Convention to this Agreement
and, thus, exclude the application of the UN Convention in its entirety to this Agreement.
* 6.2 This Agreement sets out the entire agreement between you and Unbescape for your Contributions to Unbescape
and overrides all other agreements or understandings.
* 6.3 If You or Unbescape assign the rights or obligations received through this Agreement to a third party, as a
condition of the assignment, that third party must agree in writing to abide by all the rights and
obligations in the Agreement.
* 6.4 The failure of either party to require performance by the other party of any provision of this
Agreement in one situation shall not affect the right of a party to require such performance at any time
in the future. A waiver of performance under a provision in one situation shall not be considered a
waiver of the performance of the provision in the future or a waiver of the provision in its entirety.
* 6.5 If any provision of this Agreement is found void and unenforceable, such provision will be
replaced to the extent possible with a provision that comes closest to the meaning of the original
provision and which is enforceable. The terms and conditions set forth in this Agreement shall apply
notwithstanding any failure of essential purpose of this Agreement or any limited remedy to the
maximum extent possible under law.
unbescape-unbescape-1.1.5.RELEASE/ChangeLog.txt 0000664 0000000 0000000 00000003461 13114102336 0021073 0 ustar 00root root 0000000 0000000 1.1.5.RELEASE
=============
- Fixed unescaping of some HTML5 NCRs (Named Character References) which are allowed to be specified without
a semicolon-char suffix (e.g. " ").
- Added to XmlEscape specific methods for performing escape operations on XML attribute values. These methods will
always perform the escaping of the \t, \n and \r characters to avoid a possible loss of information when the XML
document is read by a parser, as according to the XML spec at https://www.w3.org/TR/REC-xml/#AVNormalize all
these three characters would be normalised to white-space.
1.1.4.RELEASE
=============
- Added ampersand (&) to the list of characters to be escaped in LEVEL 1 for JSON, JavaScript and CSS literals
in order to make escaped code safe against code injection attacks in XHTML scenarios (browsers using XHTML
processing mode) performed by means of including XHTML escape codes in literals.
1.1.3.RELEASE
=============
- Improved performance of String-based unescape methods for HTML, XML, JS, JSON and others when the
text to be unescaped actually needs no unescaping.
1.1.2.RELEASE
=============
- Added support for stream-based (String-to-Writer and Reader-to-Writer) escape and unescape operations.
1.1.1.RELEASE
=============
- Fixed HTML unescape for codepoints > U+10FFFF (was throwing IllegalArgumentException).
- Fixed HTML unescape for codepoints > Integer.MAX_VALUE (was throwing ArrayIndexOutOfBounds).
- Simplified and improved performance of codepoint-computing code by using Character.codePointAt(...) instead
of a complex conditional structure based on Character.isHighSurrogate(...) and Character.isLowSurrogate(...).
- [doc] Fixed description of MSExcel-compatible CSV files.
1.1.0.RELEASE
=============
- Added URI/URL escape and unescape operations.
1.0
===
- First release of unbescape.
unbescape-unbescape-1.1.5.RELEASE/LICENSE.txt 0000664 0000000 0000000 00000026136 13114102336 0020332 0 ustar 00root root 0000000 0000000
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
unbescape-unbescape-1.1.5.RELEASE/NOTICE.txt 0000775 0000000 0000000 00000001162 13114102336 0020224 0 ustar 00root root 0000000 0000000
Copyright (c) 2014, The UNBESCAPE team (http://www.unbescape.org)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
unbescape-unbescape-1.1.5.RELEASE/README.markdown 0000664 0000000 0000000 00000036647 13114102336 0021220 0 ustar 00root root 0000000 0000000
Unbescape: escape and unescape operations in Java
=================================================
------------------------------------------------------------------------------
_Unbescape_ is a Java library aimed at performing fully-featured and high-performance escape and unescape
operations for:
* **HTML** (HTML5 and HTML 4)
* **XML** (XML 1.0 and XML 1.1)
* **JavaScript**
* **JSON**
* **URI**/**URL**
* **CSS**
* **CSV** (Comma-Separated Values)
* **Java literals**
* **Java `.properties` files**
Status
------
This project is stable and production-ready.
Current versions:
* Version **1.1.4.RELEASE** (27 Sep 2016)
License
-------
This software is licensed under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).
Requirements
------------
* Java SE 5.0 or higher
Maven info
----------
* groupId: `org.unbescape`
* artifactId: `unbescape`
* version: (see _Current Versions_ above)
Features
--------
* **High performance**
* No unneeded `String` or `char[]` objects are created, and specific optimizations are applied in order to provide maximum performance and reduce Garbage Collector latency (e.g. if a `String` has the same content after escaping/unescaping, exactly the same `String` object is returned, no copy is made).
* See (and execute) the [`benchmark.sh`](https://github.com/unbescape/unbescape-tests/blob/20140429/benchmark.sh) script in the
[`unbescape-tests`](https://github.com/unbescape/unbescape-tests) repository for specific figures.
* **Highly configurable**
* Most escaped languages allow specifying the _type_ of escape to be performed: based on literals, on decimal numbers, hexadecimal, octal, etc.
* Most escaped languages allow specifying the _level_ of escape to be performed: only escape the _basic set_, escape _all non-ASCII characters_, escape _all non-alphanumeric_, etc.
* Provides sensible defaults and pre-configured, easy-to-use methods.
* **Documented API**
* Includes full JavaDoc API documentation for all public classes, explaining each escape and unescape operation in detail.
* **Unicode**
* All escape and unescape operations support the whole Unicode character set: `U+0000` to `U+10FFFF`, including characters not representable by only one char in Java (>`U+FFFF`).
* **HTML Escape/Unescape**
* Whole **HTML5** NCR (Named Character Reference) set supported, if required: `]`,`
`, etc. (HTML 4 set available too).
* Mixed named and numerical (decimal or hexa) character references supported.
* Ability to default to numerical (decimal or hexa) references when an applicable NCR does not exist (depending on the selected operation level).
* Support for unescape of double-char NCRs in HTML5: `fj` → `fj`.
* Support for a set of HTML5 unescape tweaks included in the HTML5 specification:
* Unescape of numerical character references not ending in semi-colon (e.g. `⎬`).
* Unescape of specific NCRs not ending in semi-colon (e.g. `á`).
* Unescape of specific numerical character references wrongly specified by their Windows-1252 codepage code instead of the Unicode one (e.g. `` for `€` (`€`) instead of `€`).
* **XML Escape/Unescape**
* Support for both XML 1.0 and XML 1.1 escape/unescape operations.
* No support for DTD-defined or user-defined entities. Only the five predefined XML character entities are supported: `<`, `>`, `&`, `"` and `'`.
* Automatic escaping of allowed control characters.
* **JavaScript Escape/Unescape**
* Support for the JavaScript basic escape set: `\0`, `\b`, `\t`, `\n`, `\v`, `\f`, `\r`, `\"`, `\'`, `\\`.
Note that `\v` (`U+000B`) will not be used in escape operations (only unescape) because it is
not supported by Microsoft Internet Explorer versions < 9.
* Automatic escape of `/` (as `\/` if possible) when it appears after `<`, as in ``.
* Support for escaping non-displayable, control characters: `U+0001` to `U+001F` and `U+007F` to `U+009F`.
* Support for X-based hexadecimal escapes (a.k.a. _hexadecimal escapes_) both in escape
and unescape operations: `\xE1`.
* Support for U-based hexadecimal escapes (a.k.a. _unicode escapes_) both in escape
and unescape operations: `\u00E1`.
* Support for Octal escapes, though only in unescape operations: `\071`. Not supported
in escape operations (octal escapes were deprecated in version 5 of the ECMAScript
specification).
* **JSON Escape/Unescape**
* Support for the JSON basic escape set: `\b`, `\t`, `\n`, `\f`, `\r`, `\"`, `\\`.
* Automatic escape of `/` (as `\/` if possible) when it appears after `<`, as in ``.
* Support for escaping non-displayable, control characters: `U+0000` to `U+001F` and `U+007F` to `U+009F`.
* Support for U-based hexadecimal escapes (a.k.a. _unicode escapes_) both in escape
and unescape operations: `\u00E1`.
* **URI/URL Escape/Unescape**
* Support for escape operations using percent-encoding (`%HH`).
* Escape URI paths, path fragments, query parameters and fragment identifiers.
* **CSS Escape/Unescape**
* Complete set of CSS _Backslash Escapes_ supported (e.g. `\+`, `\;`, `\(`, `\)`, etc.).
* Full set of escape syntax rules supported, both for **CSS identifiers** and **CSS Strings**
(or _literals_).
* Non-standard tweaks supported: `\:` not used because of lacking support in Internet Explorer < 8,
`\_` escaped at the beginning of identifiers for better Internet Explorer 6 support, etc.
* Hexadecimal escapes (a.k.a. _unicode escapes_) are supported both in escape and unescape operations,
and both in _compact_ (`\E1 `) and six-digit forms (`\0000E1`).
* Support for unescaping unicode characters >`\uFFFF` both when represented in standard form (one char,
`\20000`) and non-standard (surrogate pair, `\D840\DC00`, used by older WebKit browsers).
* **CSV (Comma-Separated Values) Escape/Unescape**
* Works according to the rules specified in RFC4180 (there is no _CSV standard_ as such).
* Encloses escaped values in double-quotes (`"value"`) if they contain any non-alphanumeric characters.
* Escapes double-quote characters (`"`) by writing them twice: `""`.
* Honors rules for maximum compatibility with Microsoft Excel.
* **Java Literal Escape/Unescape**
* Support for the Java basic escape set: `\b`, `\t`, `\n`, `\f`, `\r`, `\"`, `\'`, `\\`. Note `\'` will not be
used in escaping levels < 3 (= _all but alphanumeric_) because escaping the apostrophe is not really required in Java String literals
(only in Character literals).
* Support for escaping non-displayable, control characters: `U+0001` to `U+001F` and `U+007F` to `U+009F`.
* Support for U-based hexadecimal escapes (a.k.a. _unicode escapes_) both in escape
and unescape operations: `\u00E1`.
* Support for Octal escapes, though only in unescape operations: `\071`. Not supported
in escape operations (use of octal escapes is not recommended by the Java Language Specification).
* **Java `.properties` File Escape/Unescape**
* Support for the Java Properties basic escape set: `\t`, `\n`, `\f`, `\r`, `\\`. When escaping `.properties`
keys (not values) `\ `, `\:` and `\=` will be applied too.
* Support for escaping non-displayable, control characters: `U+0001` to `U+001F` and `U+007F` to `U+009F`.
* Support for U-based hexadecimal escapes (a.k.a. _unicode escapes_) both in escape
and unescape operations: `\u00E1`.
------------------------------------------------------------------------------
HTML Escape/Unescape
-------------------------
HTML escape and unescape operations are performed by means of the `org.unbescape.html.HtmlEscape` class. This class
defines a series of static methods that perform the desired operations (see the class _javadoc_ for more info).
There are simple, preconfigured methods:
```java
final String escaped = HtmlEscape.escapeHtml5(text);
final String unescaped = HtmlEscape.unescapeHtml(escaped);
```
And also those that allow a more fine-grained configuration of the escape operation:
```java
final String result =
HtmlEscape.escapeHtml(
text,
HtmlEscapeType.HTML4_NAMED_REFERENCES_DEFAULT_TO_HEXA,
HtmlEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT);
```
XML Escape/Unescape
-------------------------
XML escape and unescape operations are performed by means of the `org.unbescape.xml.XmlEscape` class. This class
defines a series of static methods that perform the desired operations (see the class _javadoc_ for more info).
There are simple, preconfigured methods:
```java
final String escaped = XmlEscape.escapeXml11(text);
final String unescaped = XmlEscape.unescapeXml(escaped);
```
And also those that allow a more fine-grained configuration of the escape operation:
```java
final String result =
XmlEscape.escapeXml11(
text,
XmlEscapeType.CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_DECIMAL,
XmlEscapeLevel.LEVEL_3_ALL_NON_ALPHANUMERIC);
```
JavaScript Escape/Unescape
--------------------------
JavaScript escape and unescape operations are performed by means of the `org.unbescape.javascript.JavaScriptEscape`
class. This class defines a series of static methods that perform the desired operations
(see the class _javadoc_ for more info).
There are simple, preconfigured methods:
```java
final String escaped = JavaScriptEscape.escapeJavaScript(text);
final String unescaped = JavaScriptEscape.unescapeJavaScript(escaped);
```
And also those that allow a more fine-grained configuration of the escape operation:
```java
final String result =
JavaScriptEscape.escapeJavaScript(
text,
JavaScriptEscapeType.SINGLE_ESCAPE_CHARS_DEFAULT_TO_XHEXA_AND_UHEXA,
JavaScriptEscapeLevel.LEVEL_1_BASIC_ESCAPE_SET);
```
JSON Escape/Unescape
--------------------
JSON escape and unescape operations are performed by means of the `org.unbescape.json.JsonEscape` class. This class
defines a series of static methods that perform the desired operations (see the class _javadoc_ for more info).
There are simple, preconfigured methods:
```java
final String escaped = JsonEscape.escapeJson(text);
final String unescaped = JsonEscape.unescapeJson(escaped);
```
And also those that allow a more fine-grained configuration of the escape operation:
```java
final String result =
JsonEscape.escapeJson(
text,
JsonEscapeType.SINGLE_ESCAPE_CHARS_DEFAULT_TO__UHEXA,
JsonEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET);
```
URI/URL Escape/Unescape
-----------------------
URI/URL escape and unescape operations are performed by means of the `org.unbescape.uri.UriEscape` class. This class
defines a series of static methods that perform the desired operations (see the class _javadoc_ for more info).
The methods for this type of escape/unescape operations are very simple:
```java
final String escapedPath = UriEscape.escapeUriPath(text);
final String escapedPathSegment = UriEscape.escapeUriPathSegment(text);
final String escapedQueryParam = UriEscape.escapeUriQueryParam(text);
final String escapedFragmentId = UriEscape.escapeUriFragmentId(text);
```
```java
final String unescapedPath = UriEscape.unescapeUriPath(text);
final String unescapedPathSegment = UriEscape.unescapeUriPathSegment(text);
final String unescapedQueryParam = UriEscape.unescapeUriQueryParam(text);
final String unescapedFragmentId = UriEscape.unescapeUriFragmentId(text);
```
CSS Escape/Unescape
--------------------
CSS escape and unescape operations are performed by means of the `org.unbescape.css.CssEscape` class. This class
defines a series of static methods that perform the desired operations (see the class _javadoc_ for more info).
Unbescape includes support for escaping both **CSS identifiers** and **CSS strings** (the former type apply
more strict syntax rules).
There are simple, preconfigured methods:
```java
final String escapedIdentifier = CssEscape.escapeCssIdentifier(text);
final String escapedString = CssEscape.escapeCssString(text);
final String unescaped = CssEscape.unescapeCss(escapedIdentifierOrString);
```
And also those that allow a more fine-grained configuration of the escape operation:
```java
final String identifierResult =
CssEscape.escapeCssIdentifier(
identifierText,
CssIdentifierEscapeType.BACKSLASH_ESCAPES_DEFAULT_TO_SIX_DIGIT_HEXA,
CssIdentifierEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET);
final String stringResult =
CssEscape.escapeCssString(
stringText,
CssStringEscapeType.BACKSLASH_ESCAPES_DEFAULT_TO_COMPACT_HEXA,
CssStringEscapeLevel.LEVEL_1_BASIC_ESCAPE_SET);
```
CSV Escape/Unescape
-------------------
CSV (Comma-Separated Values) escape and unescape operations are performed by means of the `org.unbescape.csv.CsvEscape` class. This class
defines a series of static methods that perform the desired operations (see the class _javadoc_ for more info).
The methods for this type of escape/unescape operations are very simple:
```java
final String escaped = CsvEscape.escapeCsv(text);
final String unescaped = CsvEscape.unescapeCsv(escaped);
```
Java Literal Escape/Unescape
----------------------------
Java escape and unescape operations are performed by means of the `org.unbescape.java.JavaEscape` class. This class
defines a series of static methods that perform the desired operations (see the class _javadoc_ for more info).
There are simple, preconfigured methods:
```java
final String escaped = JavaEscape.escapeJava(text);
final String unescaped = JavaEscape.unescapeJava(escaped);
```
And also those that allow a more fine-grained configuration of the escape operation:
```java
final String result =
JavaEscape.escapeJava(
text,
JavaEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET);
```
Java `.properties` File Escape/Unescape
---------------------------------------
Java `.properties` escape and unescape operations are performed by means of the `org.unbescape.properties.PropertiesEscape` class. This class
defines a series of static methods that perform the desired operations (see the class _javadoc_ for more info).
Unbescape includes support for escaping both **properties keys** and **properties values** (keys require additional
escaping of ` `, `:` and `=`).
There are simple, preconfigured methods:
```java
final String escapedKey = PropertiesEscape.escapePropertiesKey(text);
final String escapedString = PropertiesEscape.escapePropertiesValue(text);
final String unescaped = PropertiesEscape.unescapeProperties(escapedKeyOrValue);
```
And also those that allow a more fine-grained configuration of the escape operation:
```java
final String identifierResult =
PropertiesEscape.escapePropertiesKey(
keyText, PropertiesKeyEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET);
final String stringResult =
PropertiesEscape.escapePropertiesValue(
valueText, PropertiesValueEscapeLevel.LEVEL_1_BASIC_ESCAPE_SET);
```
unbescape-unbescape-1.1.5.RELEASE/RELEASING.txt 0000664 0000000 0000000 00000002306 13114102336 0020552 0 ustar 00root root 0000000 0000000 In order to prepare a release, this steps have to be taken:
1. In settings.xml, these entries must exist:
releases[KEYNAME (EMAIL)][GPG PASSPHRASE]sonatype-nexus-snapshots[USER IN SONATYPE NEXUS][PASSWORD IN SONATYPE NEXUS]
2. Ensure all SVN URLs in pom.xml are using "https". A "502 Bad Gateway" error will be received if not.
3. Deploy SNAPSHOT artifact to Sonatype NEXUS with "mvn deploy", and check in Nexus web interface.
4. Execute a test "no modification" run of the release:prepare goal: "mvn -Preleases release:prepare -DdryRun=true -Dusername=[SVNUSER] -Dpassword=[SVNPASS]"
5. Execute a real run of the release:prepare goal: "mvn -Preleases release:prepare -Dusername=[SVNUSER] -Dpassword=[SVNPASS]"
6. Upload the release: "mvn -Preleases release:perform -Dusername=[SVNUSER] -Dpassword=[SVNPASS]"
7. Follow instructions for Nexus at: http://nexus.sonatype.org/oss-repository-hosting.html
unbescape-unbescape-1.1.5.RELEASE/USAGE.txt 0000664 0000000 0000000 00000001147 13114102336 0020107 0 ustar 00root root 0000000 0000000
Using unbescape from Maven 2
----------------------------
To use it in your Maven 2 applications, you will need to add it as
a dependency with:
org.unbescapeunbescape{version}compile
In order for this to work correctly, you need to have previously installed
thymeleaf in your local repository (as explained in BUILD.txt) or have a
working internet connection to let maven automatically download thymeleaf
binaries from Maven 2's central repositories.
unbescape-unbescape-1.1.5.RELEASE/pom.xml 0000775 0000000 0000000 00000022440 13114102336 0020021 0 ustar 00root root 0000000 0000000
4.0.0org.unbescapeunbescapejar1.1.5.RELEASEunbescapehttp://www.unbescape.orgAdvanced yet easy-to-use escape/unescape library for JavaThe Apache Software License, Version 2.0http://www.apache.org/licenses/LICENSE-2.0.txtrepoThe UNBESCAPE teamhttp://www.unbescape.orgscm:git:git@github.com:unbescape/unbescape.gitscm:git:git@github.com:unbescape/unbescape.gitscm:git:git@github.com:unbescape/unbescape.gitunbescape-1.1.5.RELEASEdanielfernandezDaniel Fernandezdaniel.fernandez AT 11thlabs DOT orgProject AdminLead Developersonatype-nexus-snapshotsSonatype Nexus Snapshotshttps://oss.sonatype.org/content/repositories/snapshotssonatype-nexus-snapshotsSonatype Nexus Snapshotshttps://oss.sonatype.org/service/local/staging/deploy/maven2sonatype-nexus-snapshotsSonatype Nexus Snapshotshttps://oss.sonatype.org/content/repositories/snapshotstrue1.51.5src/main/resources.META-INFLICENSE.txtNOTICE.txtsrc/test/resourcesorg.apache.maven.pluginsmaven-compiler-plugin3.3${maven.compile.source}${maven.compile.target}US-ASCIIorg.apache.maven.pluginsmaven-resources-plugin2.7US-ASCIIorg.apache.maven.pluginsmaven-javadoc-plugin2.10.3protectedjava.lang${basedir}/src/main/javadoc/overview.html${basedir}/src/main/javadoc${project.reporting.outputDirectory}/api/${project.artifactId}/apidocspackagejarorg.apache.maven.pluginsmaven-source-plugin2.4packagejarorg.apache.felixmaven-bundle-plugin2.4.0bundle-manifestprocess-classesmanifestorg.apache.maven.pluginsmaven-jar-plugin2.6${project.build.outputDirectory}/META-INF/MANIFEST.MFfalsetruetrue${maven.compile.source}${maven.compile.target}org.apache.maven.pluginsmaven-gpg-plugin1.6sign-artifactsverifysignorg.apache.maven.pluginsmaven-release-plugin2.5.3org.apache.maven.pluginsmaven-assembly-plugin2.6src/assembly/dist.xmlmake-assembly-depspackagesingleorg.apache.maven.pluginsmaven-site-plugin3.4org.apache.maven.pluginsmaven-project-info-reports-plugin2.2license
unbescape-unbescape-1.1.5.RELEASE/src/ 0000775 0000000 0000000 00000000000 13114102336 0017266 5 ustar 00root root 0000000 0000000 unbescape-unbescape-1.1.5.RELEASE/src/artwork/ 0000775 0000000 0000000 00000000000 13114102336 0020757 5 ustar 00root root 0000000 0000000 unbescape-unbescape-1.1.5.RELEASE/src/artwork/unbescape.png 0000664 0000000 0000000 00000301157 13114102336 0023441 0 ustar 00root root 0000000 0000000 PNG
IHDR
f X sBIT|d pHYs v vY' tEXtSoftware www.inkscape.org< IDATx{uayf&$%@(QTxzA]/vEmk][Vez9k]uT=gǻU)^@*V"X@2?䖐<37z3$?Ϸ4MO>ƽ_G'Ydb=|WV $\뺦i&,reYdsm;ژ$ @m|/wZ&ro6