Variable-Length Character Encoding for Memory Efficiency
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing character sets, such as SBCS, MBCS, and Unicode, face limitations in memory efficiency and representation of various characters, with Unicode requiring more memory due to consistent two-byte encoding.
Innovation Solution
A method and apparatus that modify Unicode character sets by adding an offset value to character code values greater than a predetermined reference, and appending null data to the character string, allowing for reduced memory usage and efficient representation using one or two bytes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If Unicode character set is used to represent various types of characters, then character representation capability is improved, but memory usage increases due to consistent two-byte encoding
Solution Approach 1:
The patent applies dynamics by making the character encoding length variable rather than fixed. The system dynamically adjusts between one-byte and two-byte encoding based on the character type: ASCII characters (code values ≤ 0x007F) use one byte, while extended characters (code values > 0x007F) use two bytes. This dynamic adaptation resolves the contradiction by optimizing memory usage for common characters while maintaining Unicode's ability to represent various character types when needed.
Solution Approach 2:
The patent changes the encoding parameter (byte length) based on the character code value. By introducing a threshold (0x007F) and adjusting the encoding length parameter accordingly, the system achieves both memory efficiency for ASCII characters and comprehensive character representation for extended characters. The conversion process modifies the parameter structure: ASCII characters are encoded as single bytes, while extended characters use two-byte sequences with specific bit patterns.
2Quantity of substance
If SBCS is used to reduce memory usage, then memory efficiency is improved, but character representation capability deteriorates due to inability to represent various types of characters
Solution Approach 1:
The system dynamically switches between one-byte mode (for ASCII characters) and two-byte mode (for extended characters), making the encoding length adaptable rather than fixed. This dynamic behavior allows the system to achieve SBCS-level memory efficiency for common characters while maintaining the ability to represent extended character types when required, thus resolving the contradiction between memory efficiency and character representation capability.
Solution Approach 2:
The character set is segmented into two categories: ASCII characters (code values ≤ 0x007F) and extended characters (code values > 0x007F). Each segment uses an appropriate encoding length: one byte for ASCII and two bytes for extended characters. This segmentation allows the system to optimize memory usage for the majority of characters while preserving support for less common character types, resolving the contradiction between memory efficiency and versatility.
3Adaptability or versatility
If MBCS is used to represent various characters, then character representation capability is improved, but memory efficiency deteriorates due to using multiple bytes for all characters
Solution Approach 1:
The patent applies local quality by assigning different encoding lengths to different character types based on their specific needs. ASCII characters (the majority of common characters) use one-byte encoding, while only extended characters use two-byte encoding. This localized optimization resolves the contradiction by applying multi-byte encoding only where necessary (for extended characters) rather than uniformly to all characters, thus maintaining memory efficiency while preserving character representation capability.
Solution Approach 2:
The system dynamically determines the appropriate encoding length for each character based on its code value. Characters with code values ≤ 0x007F use one-byte encoding, while characters with code values > 0x007F use two-byte encoding. This dynamic adaptation allows the system to achieve better memory efficiency than traditional MBCS while maintaining the ability to represent various character types, resolving the contradiction between memory efficiency and character representation capability.
Data Source
AI summary
A method of generating a character set is provided, including: receiving two bytes of a character code value and determining whether or not the character code value is greater than a predetermined reference value; adding a predetermined offset value to the character code value and outputting the resultant value if the character code value is greater than the predetermined reference value, and outputting the character code value if the character code value is not greater than the predetermined reference value; and adding null data to the end of a character string consisting of the character code value after the character code value is input.


