AO Encoding Changelog

ao-encoding-3.2.1

Release Notes

  • Updated dependencies.

ao-encoding-3.2.0

Release Notes

  • Split development-only classes into a new sub-project in devel/. This sub-project is used only for development and is never deployed to artifact repositories.
  • Reverted a previous change made on 2020-03-01 that was released in version 3.0.0 on 2020-03-26. Encoding of in-context translation lookup markups is required after all.

    One example is the lookup IDs added inside alt attributes like alt="&lt;##&lt;value&gt;##&gt;". With this bug, this was incorrectly written as alt="<##<value>##>", which fails XML validation.

    This bug is unlikely to affect production systems for two reasons:

    1. Lookup markups are only performed when in-context translations are enabled, which is only when in development mode.
    2. Most production sites are served in SGML mode, where browsers will handle the incorrect HTML formatting. XML mode is used in development specifically for this stricter validation.

ao-encoding-3.1.0

Release Notes

  • Moved a few date/time methods from ChainWriter to AOWeb Struts Core. This avoids adding a dependency on the new AO SQL project that has been split from AO Lang and AOCode Public:

    1. Moved ChainWriter.writeDateJavaScript(…) to DateTag.
    2. Moved ChainWriter.writeDateTimeJavaScript(…) to DateTimeTag.
    3. Moved ChainWriter.writeTimeJavaScript(…) to TimeTag.

    Although technically a breaking change, we are only incrementing the minor version number. This is legacy code that is not central to this encoding API and is not widely used. In fact, ChainWriter should probably not be part of this API at all, but it has no better home at this time.

ao-encoding-3.0.0

Release Notes

  • Minimum Java version changed from 1.7 to 1.8.
  • Reduced use of property substitutions in pom.xml. This is to help 3rd-party parsers that fail to perform full Maven-compatible substitutions.
  • Now outputting HTML or XHTML based on the current response content type. This should eliminate validator warnings when used as HTML.
  • ChainWriter no longer writes &#160; as a placeholder for null values. This technique was used for ancient browsers that would not display completely empty table cells. This has not been the case for a long time.
  • JSON doesn't support comments, avoiding bundle lookup markups.
  • Consolidated writeWithMarkup(…) methods into Coercion class directly.
  • New static encoding methods for writing Object via Coercion.toString(Object).
  • Implemented Coercion.append(…) methods for working with Appendable.
  • ChainWriter will never wrap a PrintWriter with another PrintWriter, even when autoFlush settings do not match.
  • Added Coercion support for CharSequence.
  • Added Coercion support for char[].
  • Coercion now trims String and CharSequence based on code points, with a value considered whitespace when it is either <= '\u0020' (for compatibility with String.trim()) or Character.isWhitespace(int).
  • Avoiding unnecessary coercion to String when there is no active in-context translation.
  • ChainWriter.encodeHtml(…) (deprecated) now require additional isXhtml flag.
  • ChainWriter.writeHtmlImagePreloadJavaScript(…) moved to new ao-fluent-html project at ImagePreload.writeImagePreloadScript(…).
  • New enums for encoding context: Doctype and Serialization, which can be used to affect the encoding based on context.
  • JavaScript default type changed from text/javascript to application/javascript.
  • JavaScript encoder now uses context to determine both type and when to use CDATA.
  • EncodingContext is now optional, with default behaviors defined.
  • Renamed ChainWriter.encode*(Object) methods to ChainWriter.textIn*(Object).

    Also, all implementations add encoder prefixes and suffixes where appropriate, such as double quotes around text in JavaScript.

    Furthermore, all implementations perform translation markup.

  • New methods MediaWriter.text(…) for writing arbitrary textual data with automatic encoding. Supports encoder prefixes and suffixes as well as in-context translation.
  • Removed MediaException, using UnsupportedEncodingException instead.
  • Completely removed NewEncodingUtils.

ao-encoding-2.1.0

Release Notes

  • New method Coercion.trim(Object) that returns the provided value trimmed.
  • New method Coercion.trimNullIfEmpty(Object) that returns the provided value trimmed, or null if the value is empty after trimming.
  • Added application/javascript as an alias for text/javascript.

ao-encoding-2.0.0

Release Notes

  • Removed long-deprecated method ChainWriter.printEU(String).
  • Removed long-deprecated method ChainWriter.printHTMLColor(int).
  • Removed long-deprecated method ChainWriter.printImagePreloadJS(String).
  • During coercion, XML Node will be output as UTF-8.
  • EncodingContext.encodeURL(String) no longer throws UnsupportedEncodingException.
  • UrlValidator now validates the entire URL versus RFC 3986.

ao-encoding-1.8.0

Release Notes

  • Added variations of the javascript date and time printing in ChainWriter supporting dates and times represented by long and Long.
  • Updated for compatibility with aocode-public-3.1.0.

ao-encoding-1.7.1

Release Notes

  • Using managed dependencies:
    1. This project uses managed dependencies.
    2. This project's managed dependencies may also be imported by other projects.

ao-encoding-1.7.0

Release Notes

  • Minimum Java version changed from 1.6 to 1.7.
  • Implemented encodings for Bourne shell scripts, MySQL command line mysql, and PostgreSQL command line psql.

ao-encoding-1.6.0

Release Notes

  • Bug fixes:
    1. ChainWriter.encodeJavaScriptStringInXmlAttribute was not quoting empty JavaScript string on null value.
    2. ChainWriter.encodeJavaScriptStringInXhtml was not quoting empty JavaScript string on null value.
  • Improvements:
    1. ChainWriter.flush() and ChainWriter.close() now call underlying PrintWriter.checkError() to avoid accidentally swallowing exceptions. Because PrintWriter.checkError() causes a flush, it is only invoked on flush/close and not on every print/write.
  • Updated dependencies.

ao-encoding-1.5.1

Release Notes

  • New AO OSS Parent POM to simplify pom.xml files.
  • Project documentation moved to per-project book in SemanticCMS format.
  • Added changelog as top-level project link.
  • Added support for XML DOM Node in toString type coercion.

ao-encoding-1.5.0

Release Notes

  • Improved Javadoc formatting.
  • Improved README formatting.
  • Added support for application/json and application/ld+json encoding.

ao-encoding-1.4.1

Release Notes

  • Escape for ]]> didn't work as hoped.

ao-encoding-1.4.0

Release Notes

  • Quick empty to null conversion.
  • Shortcut for Strings.
  • Additional type coercions.
  • Encoding ']' to avoid potential ]]> from escaping CDATA early.

ao-encoding-1.3.1

Release Notes

  • Minor release, only a packaging change.

ao-encoding-1.3

Release Notes

  • Efficient way to check if objects are empty.

ao-encoding-1.2

Release Notes

  • Improved Javadoc formatting.

ao-encoding-1.1

Release Notes

  • Reverted to Java 1.6 for Android and Java EE 6 compatibility.

ao-encoding-1.0

Release Notes

  • Project moved to GitHub and Maven.