Close menu

Standard Compression Scheme for Unicode


Source: http://en.wikipedia.org/wiki/Standard_Compression_Scheme_for_Unicode
Updated: 2017-08-04T18:16Z

The Standard Compression Scheme for Unicode (SCSU)[1] is a Unicode Technical Standard for reducing the number of bytes needed to represent Unicode text, especially if that text uses mostly characters from one or a small number of per-language character blocks. It does so by dynamically mapping values in the range 128–255 to offsets within particular blocks of 128 characters. The initial conditions of the encoder mean that existing strings in ASCII and ISO-8859-1 that do not contain C0 control codes other than NULL TAB CR and LF can be treated as SCSU strings. Since most alphabets do reside in blocks of contiguous Unicode codepoints, texts that use small alphabets and either ASCII punctuation or punctuation that fits within the window for the main alphabet can be encoded at one byte per character (plus setup overhead, which for common languages is often only 1 byte), most other punctuation can be encoded at 2 bytes per symbol through non-locking shifts. SCSU can also switch to UTF-16 internally to handle non-alphabetic languages.

Symbian OS, an operating system for mobile phones and other mobile devices, uses SCSU to serialise strings.

Reuters, the organization that floated the first draft of SCSU, is believed to use SCSU internally.

SQL Server 2008 R2 uses SCSU to compress Unicode values stored in nchar(n) and nvarchar(n) columns, achieving space savings between 15% and 50%, depending on the language of the data.[2]

Comparison with general-purpose plain text compression schemes

In comparison with general-purpose compressors, it is not necessarily advantageous to use SCSU. Few applications need to compress so much Unicode text that it is worth using a special-purpose compression scheme which does not have widespread support. Also, while it can be used as a text encoding, it can be difficult to handle internally.

Treated purely as a compression algorithm, SCSU is inferior to most commonly used general-purpose algorithms for texts of over a few kilobytes.

SCSU does have the advantage that it can usefully compress texts that are only a few characters long, whereas most full-scale compressors need hundreds of bytes of data to break even against their own overhead. In Symbian OS, SCSU is used even for Clipboard operations, e.g. Cut, Copy & Paste of small strings of text.

In HTML

Supporting SCSU in HTML documents is prohibited by the W3C[3][4] and WHATWG[5] HTML standards, as it would present a cross-site scripting vulnerability.[6]

See also

References

  1. ^ "UTS #6: Compression Scheme for Unicode". 2005-05-06. Retrieved 2008-06-13. 
  2. ^ "Unicode Compression Implementation (SQL Server 2008 R2 Books Online)". Retrieved 2008-08-18. 
  3. ^ "8.2.2.3. Character encodings". HTML 5.1 Standard. W3C. 
  4. ^ "8.2.2.3. Character encodings". HTML 5 Standard. W3C. 
  5. ^ "12.2.3.3 Character encodings". HTML Living Standard. WHATWG. 
  6. ^ "<meta> - HTML". MDN Web Docs. Mozilla. 
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.

Also On Wow

    Advertisement

    Trending Now