IP Library Granted Patent US 9,720,885
Granted Patent B2
US 9,720,885 · App. 13/421,377 · Granted Aug 1, 2017

Detection of UTF-16 encoding in streaming XML data without a byte-order mark and related printers, systems, methods, and computer program products

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,720,885
App. No.
13/421,377
Granted
Aug 1, 2017
Kind
B2
Abstract

Provided are printers and other electronic devices, systems, methods, and computer program products that automatically detect and determine UTF-16 encoding schemes and endiannesss thereof in an incoming XML data steam for XML declarations without a UTF-16 byte-order mark (BOM) or encoding declaration. This allows for the automatic and unambiguous accurate detection of UTF-16 encoded XML data within a mixed encoding environment, such as from multiple sources using more than one encoding scheme, even when XML data does not start with a BOM or encoding declaration.

Claims (81)

1. A method, comprising:

automatically determining, using a processor, a unicode transformation format 16-bit (UTF-16) encoding scheme in an incoming data stream without a byte-order mark, wherein automatically determining the UTF-16 encoding scheme comprises:

detecting a first particular byte at a position relative to a second particular byte in the incoming data stream, wherein the first particular byte is a null byte and the second particular byte identifies a transition character; and

determining the UTF-16 encoding scheme based on the first particular byte being at the position relative to the second particular byte;

inserting a byte-order mark into the incoming data stream identifying the automatically determined UTF-16 encoding scheme of the incoming data stream to create an enhanced incoming XML data stream; and

transmitting the enhanced incoming XML data stream to a printer.

2. The method of claim 1 , further comprising:

receiving structure markup language data in the incoming data stream; and

processing the incoming data stream according to the automatically determined UTF-16 encoding scheme.

3. The method of claim 1 , wherein automatically determining the UTF-16 encoding scheme, comprises:

receiving structure markup language data in the incoming data stream; and

storing a current encoding status of the incoming data stream as the automatically determined UTF-16 encoding scheme.

4. The method of claim 1 , wherein automatically determining the UTF-16 encoding scheme, comprises:

receiving the incoming data stream;

storing a current encoding status of the incoming data stream;

monitoring the incoming data stream for the presence of the second particular byte;

when the second particular byte is identified, determining if a byte following the second particular byte is the first particular byte; and

if the byte following the second particular byte is the first particular byte and if the current encoding status is not UTF-16LE, then:

determining if a byte before the second particular byte is the first particular byte;

if the byte before the second particular byte is the first particular byte, then begin processing the incoming data stream as UTF-16BE and storing the current encoding status of the incoming data stream as UTF-16BE; and

if the byte before the second particular byte is not the first particular byte, then begin processing the incoming data stream as UTF-16LE and storing the current encoding status of the incoming data stream as UTF-16LE.

5. The method of claim 1 , wherein automatically determining the UTF-16 encoding scheme, comprises:

receiving the incoming data stream;

storing a current encoding status of the incoming data stream;

monitoring the incoming data stream for the presence of the second particular byte;

when the second particular byte is identified, determining if a byte following the second particular byte is the first particular byte; and

if the byte following the second particular byte is the first particular byte and if the current encoding status is not UTF-16LE, then:

determining if a byte before the second particular byte is the first particular byte; and

if the byte before the second particular byte is the first particular byte, then begin processing the incoming data stream as UTF-16BE and storing the current encoding status of the incoming data stream as UTF-16BE.

6. The method of claim 1 , wherein automatically determining the UTF-16 encoding scheme, comprises:

receiving the incoming data stream;

storing a current encoding status of the incoming data stream;

monitoring the incoming data stream for the presence of the second particular byte;

when the second particular byte is identified, determining if a byte following the second particular byte is the first particular byte; and

if the byte following the second particular byte is the first particular byte and if the current encoding status is not UTF-16LE, then:

determining if a byte before the second particular byte is the first particular byte; and

if the byte before the second particular byte is not the first particular byte, then begin processing the incoming data stream as UTF-16LE and storing the current encoding status of the incoming data stream as UTF-16LE.

7. The method of claim 1 , wherein automatically determining the UTF-16 encoding scheme, comprises:

receiving the incoming data stream;

storing a current encoding status of the incoming data stream;

monitoring the incoming data stream for the presence of the second particular byte;

when the second particular byte is identified, determining if a byte following the second particular byte is the first particular byte; and

if the byte following the second particular byte is the first particular byte and if the current encoding status is UTF-16LE, then:

determining if the two bytes before the second particular byte are each the first particular byte;

if the two bytes before the second particular byte are both the first particular byte, then begin processing the incoming data stream as UTF-16BE and storing the current encoding status of the incoming data stream as UTF-16BE; and

if the two bytes before the second particular byte are not both the first particular byte, then begin processing the incoming data stream as UTF-16LE and storing the current encoding status of the incoming data stream as UTF-16LE.

8. The method of claim 1 , wherein automatically determining the UTF-16 encoding scheme, comprises:

receiving the incoming data stream;

storing a current encoding status of the incoming data stream;

monitoring the incoming data stream for the presence of the second particular byte;

when the second particular byte is identified, determining if a byte following the second particular byte is the first particular byte; and

if the byte following the second particular byte is the first particular byte and if the current encoding status is UTF-16LE, then:

determining if the two bytes before the second particular byte are both the first particular byte; and

if the two bytes before the second particular byte are both the first particular byte, then begin processing the incoming data stream as UTF-16BE and storing the current encoding status of the incoming data stream as UTF-16BE.

9. The method of claim 1 , wherein automatically determining the UTF-16 encoding scheme, comprises:

receiving the incoming data stream;

storing a current encoding status of the incoming data stream;

monitoring the incoming data stream for the presence of the second particular byte;

when the second particular byte is identified, determining if a byte following the second particular byte is the first particular byte; and

if the byte following the second particular byte is the first particular byte and if the current encoding status is UTF-16LE, then:

determining if the two bytes before the second particular byte are both the first particular byte; and

if the two bytes before the second particular byte are not both the first particular byte, then begin processing the incoming data stream as UTF-16LE and storing the current encoding status of the incoming data stream as UTF-16LE.

10. The method of claim 1 , wherein the incoming data stream comprises XML data.

11. An electronic device comprising at least one processor and at least one memory including computer program code, the processor is configured to, in cooperation with the at least one memory and the computer program code, cause the electronic device to:

receive structure markup language data without a byte-order mark in an incoming data stream;

automatically determine a unicode transformation format 16-bit (UTF-16) encoding scheme of the structure markup language data without a byte-order mark, wherein automatically determining the UTF-16 encoding scheme comprises detecting a presence of first particular byte at a position relative to a second particular byte and determining a current encoding scheme based on the presence of the first particular byte at the position, wherein the first particular byte is a null byte and the second particular byte identifies a transition character;

insert a byte-order mark into the incoming data stream identifying the automatically determined UTF-16 encoding scheme of the incoming data stream to create an enhanced incoming XML data stream; and

transmit the enhanced incoming XML data stream to a printer.

12. The electronic device of claim 11 , wherein the structure markup language data is XML data.

13. The electronic device of claim 11 , wherein the electronic device comprises a printer.

14. The electronic device of claim 11 , wherein the electronic device comprises a print server.

15. The electronic device of claim 11 , wherein the electronic device comprises a software print driver.

16. The electronic device of claim 11 , wherein the electronic device comprises a bar code scanner.

17. The electronic device of claim 11 , wherein the electronic device comprises a radio frequency identification (RFID) reader/writer.

18. A printing system, comprising:

a first electronic device;

a print server communicatively connected to the first electronic device and comprising a communication interface configured to receive data from the first electronic device in an incoming data stream received by the print server, wherein the printer comprises an XML processor and a memory including computer program code, the XML processor configured to, in cooperation with the memory and the computer program code, cause the print server to:

process the incoming data stream to automatically determine a unicode transformation format 16-bit (UTF-16) encoding scheme in the incoming data stream without a byte-order mark by detecting a first particular byte at a position relative to a second particular byte in the incoming data stream and determining the UTF-16 encoding scheme based on the first particular byte being at the position relative to the second particular byte, wherein the first particular byte is a null byte and the second particular byte identifies a transition character,

insert a byte-order mark into the incoming data stream identifying the automatically determined UTF-16 encoding scheme of the incoming data stream to create an enhanced incoming XML data stream, and

transmit the enhanced incoming XML data stream; and

a printer communicatively connected to the print server and configured to receive the enhanced incoming XML data stream.

Assignments (7)
RELEASE OF SECURITY INTEREST - 364 - DAY Recorded Mar 5, 2021
From: JPMORGAN CHASE BANK, N.A.
To: ZEBRA TECHNOLOGIES CORPORATION; LASER BAND, LLC; TEMPTIME CORPORATION
Reel/Frame 056036/0590 →
SECURITY INTEREST Recorded Sep 1, 2020
From: ZEBRA TECHNOLOGIES CORPORATION; LASER BAND, LLC; TEMPTIME CORPORATION
To: JPMORGAN CHASE BANK, N.A.
Reel/Frame 053841/0212 →
NOTICE OF TRANSFER OF SECURITY INTEREST IN PATENTS Recorded Jul 3, 2019
From: ZEBRA TECHNOLOGIES CORPORATION
To: JPMORGAN CHASE BANK, N.A., AS COLLATERAL AGENT
Reel/Frame 049675/0049 →
MERGER Recorded Mar 29, 2019
From: ZIH CORP.
To: ZEBRA TECHNOLOGIES CORPORATION
Reel/Frame 048884/0618 →
PATENT SECURITY INTEREST ASSIGNMENT AGREEMENT Recorded Oct 25, 2017
From: MORGAN STANLEY SENIOR FUNDING, INC., AS THE EXISTING AGENT
To: JPMORGAN CHASE BANK, N.A., AS THE SUCCESSOR AGENT
Reel/Frame 044791/0842 →
SECURITY AGREEMENT Recorded Oct 31, 2014
From: ZIH CORP.; LASER BAND, LLC; ZEBRA ENTERPRISE SOLUTIONS CORP.; SYMBOL TECHNOLOGIES, INC.
To: MORGAN STANLEY SENIOR FUNDING, INC. AS THE COLLATERAL AGENT
Reel/Frame 034114/0270 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 19, 2012
From: SUSI, FERDINAND C, III; WETTSTEIN, JESSICA
To: ZIH CORP.
Reel/Frame 027882/0595 →