CN101702149A - Method for displaying electronic book with movable terminal and device thereof - Google Patents
Method for displaying electronic book with movable terminal and device thereof Download PDFInfo
- Publication number
- CN101702149A CN101702149A CN200910212395A CN200910212395A CN101702149A CN 101702149 A CN101702149 A CN 101702149A CN 200910212395 A CN200910212395 A CN 200910212395A CN 200910212395 A CN200910212395 A CN 200910212395A CN 101702149 A CN101702149 A CN 101702149A
- Authority
- CN
- China
- Prior art keywords
- data
- byte
- book
- module
- character
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Telephone Function (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention relates to a method for displaying an electronic book with a movable terminal and a device thereof. The method comprises the steps of: 1. acquiring the coded format of the electronic book memorized in the movable terminal to obtain the number of bytes occupied by each Chinese character; 2. reading the data of the electronic book; 3. confirming the Chinese character in the data byte by byte according to the compiling format in the step 1; and 4. judging whether the residual bytes are complete, wherein if the residual bytes are complete, the movable terminal displays the read data, and if residual bytes are not complete, the movable terminal displays the read data which not includes the residual bytes. The invention judges whether the residual bytes can express one Chinese character by confirming the each character in the read data of the electronic book byte by byte, and can not display the incomplete residual bytes if the residual bytes are not complete. Therefore, when a user reads the electronic book, messy code caused by reading some bytes of the Chinese characters at the final part can be avoided, thereby improving the reading experience of the user.
Description
Technical field
The present invention relates to field of mobile terminals, particularly relate to a kind of method and apparatus of displaying electronic book with movable terminal.
Background technology
At present, along with the continuous development of mobile communication technology, portable terminal has been deep in people's the life, and mobile communication has also become the most widely used communication mode.Here, the alleged portable terminal of the present invention is meant that mobile phone, personal digital assistant (PDA, Personal Digital Assistant) etc. have the small hand-held formula mobile communication equipment of wireless communication function.
With the mobile phone is example, and common mobile phone value-added service implementation is divided into note, voice, WAP (WirelessApplication Protocol, WAP (wireless application protocol)) etc., wherein, can satisfy the many-sided application demand of user with the WAP business.The user can download operations such as mp3, picture, e-book from the website of content service provider by using the WAP service on net.
In the prior art, the user need show e-book by mobile phone screen when reading electronic book (being generally TXT, i.e. text file format).At this moment, mobile phone is divided into several portions with electronic book data to be handled, and promptly reads the data of some bytes at every turn, shows again.But, because the shared data of Chinese character (and various SBC case) that comprise in the e-book are generally a plurality of bytes, therefore, if last byte in the each data that read of mobile phone only is a part of Chinese character, then this Chinese character can be shown as mess code, influences user's reading experience.Therefore, need a kind of method and apparatus that can accurately show e-book.
Summary of the invention
At defective that exists in the prior art and deficiency, the objective of the invention is to propose a kind of method and apparatus, can accurately show the e-book content.
In order to achieve the above object, the present invention proposes a kind of method of displaying electronic book with movable terminal, comprising:
Step 1: obtain the coded format that is stored in e-book in the described portable terminal, obtain the shared byte number of each Chinese character;
Step 2: the data that read described e-book;
Step 3: according to coded format described in the step 1, the byte-by-byte character of determining that described data comprise;
Step 4: judge whether remainder bytes is complete, if then show the described data that read at described portable terminal; If not, show the data that do not comprise described remainder bytes in the described data that read at described portable terminal.
Preferred as technique scheme, the byte-by-byte character of determining that described data comprise is specially in the described step 3:
When data to be determined be 1 byte and its most significant digit for false, or the byte number of data to be determined equals the described byte number in the step 1, and its most significant digit is true time, just is defined as a character.
Preferred as technique scheme, the incomplete determination methods of remainder bytes described in the described step 3 is specially:
When the byte number of remainder bytes less than byte number described in the step 1, and its most significant digit is true, then described remainder bytes is imperfect.
Preferred as technique scheme, described step 2 also comprise step after reading the data of described e-book: judge whether described size of data is zero, if then finish; If not, execution in step 3 then.
Preferred as technique scheme, also comprise step after the described step 4: whether the data of judging described e-book all show, if then finish; If not, then return execution in step 2.
The present invention also proposes a kind of device of displaying electronic book with movable terminal, comprising:
Obtain information module, be used for obtaining the coded format that is stored in described portable terminal e-book, obtain the shared byte number of each Chinese character;
The reading of data module is used to read the data of described e-book;
Determine character module, be used for the described coded format of obtaining information module according to described, the byte-by-byte character of determining that described data comprise;
First judge module is used to judge whether remainder bytes is complete;
Display module is used for showing described data at portable terminal, and when remainder bytes is imperfect, shows the data that do not comprise described remainder bytes in the described data.
Preferred as technique scheme, described definite character module specifically is used for:
When data to be determined be 1 byte and its most significant digit for false, or the byte number of data to be determined equals the described described byte number that obtains in the information module, and its most significant digit is true time, just is defined as a character.
Preferred as technique scheme, described judge module specifically is used for:
When the byte number of remainder bytes less than the described described byte number that obtains in the information module, and its most significant digit is true time, then described remainder bytes is imperfect, otherwise described remainder bytes is complete.
Preferred as technique scheme also comprises second judge module, is used to judge whether the described size of data of described reading of data module is zero.
Preferred as technique scheme also comprises the 3rd judge module, is used to judge that whether described display module all shows the data of described e-book, if then finish; If not, then continue to read the data of described e-book by described reading of data module.
The present invention determines each character by the electronic book data that reads is word for word saved land, and whether can represent a complete character to judge remainder bytes, if then all show; If not, then incomplete remainder bytes can not shown.Therefore, the user is when each reading electronic book content, and decline can mess code not occur because of the partial bytes that reads character, has therefore improved user's reading experience.
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is described in further detail.For the person of ordinary skill in the field, from detailed description of the invention, above-mentioned and other purposes of the present invention, feature and advantage will be apparent.
Description of drawings
Fig. 1 is the composition synoptic diagram of the device of the displaying electronic book with movable terminal of the present invention's proposition;
Fig. 2 is the schematic flow sheet of the preferred embodiment of the method for the displaying electronic book with movable terminal of the present invention's proposition.
Embodiment
Below a kind of portable terminal that proposes for the present invention shows the preferred embodiment of the device of compressed format picture, as shown in Figure 1, comprise: obtain information module 101, reading of data module 102, determine character module 103, first judge module 104 and display module 105, wherein
Obtain information module 101 and be used for obtaining the coded format that is stored in described portable terminal e-book, obtain the shared byte number of each Chinese character;
Reading of data module 102 is used to read the data of described e-book;
Determine that character module 103 is used for the described coded format of obtaining information module according to described, the byte-by-byte character of determining that described data comprise;
Wherein, described definite character module 103 specifically is used for: when data to be determined are that 1 byte and its most significant digit are vacation, or the byte number of data to be determined equals the described described byte number that obtains in the information module, and its most significant digit is true time, just is defined as a character.
Described first judge module 104 specifically is used for: when the byte number of remainder bytes less than the described described byte number that obtains information module, and its most significant digit is true time, then described remainder bytes is imperfect, otherwise described remainder bytes is complete.
In the above-described embodiments, also comprise second judge module, be used for whether the described described size of data of judging that described reading of data module 102 reads is zero.
Can also comprise the 3rd judge module, be used to judge that whether described display module 105 all shows the data of described e-book, if then finish; If not, then continue to read the data of described e-book by described reading of data module 102.
The preferred embodiment of the method for a kind of displaying electronic book with movable terminal that the present invention proposes comprises as shown in Figure 2:
Step 1: obtain the coded format that is stored in e-book in the described portable terminal, obtain the shared byte number of each Chinese character;
Usually, e-book comprises GBK and UTF8 coded format, and wherein, if adopt the GBK coded format, each Chinese character generally takies 2 bytes, if adopt the UTF8 coded format, each Chinese character generally takies 3 bytes.
Step 2: the data that read described e-book;
The data that read e-book normally read some and are not whole data, in the present embodiment, can be 1KB, i.e. 1024 bytes.
Step 3: according to coded format described in the step 1, the byte-by-byte character of determining that described data comprise;
Here, if show the e-book content for the first time, the data that file pointer is pointed to read begin part most, then, progressively moving hand comes the byte-by-byte character that comprises determined, if be not to show for the first time the e-book content, then from the current location of file pointer, progressively moving hand comes the byte-by-byte character that comprises determined.The method of determining can be specially:
When data to be determined are that 1 byte and its most significant digit are vacation; Or the byte number of data to be determined equals the described byte number in the step 1, and its most significant digit is true time, just is defined as a character.
For example:
Data to be determined are that 1 byte (byte is 8, xxxx xxxx) and its most significant digit are false (0xxxxxxx), and then these data to be determined of explanation are half-angle English, numeral or other symbols;
Data to be determined are 2 bytes, its most significant digit is true (1xxx xxxx), and learn that according to the information of obtaining in step 1 this e-book adopts the GBK coded format, promptly its Chinese character takies 2 bytes, and then these data to be determined of explanation are Chinese character or other SBC cases;
Data to be determined are 3 bytes, its most significant digit is true (1xxx xxxx), and learn that according to the information of obtaining in step 1 this e-book adopts the UTF8 coded format, promptly its Chinese character takies 3 bytes, and then these data to be determined of explanation are Chinese character or other SBC cases.
Like this, pointer word for word saves land and moves to the end of the electronic book data that reads, and at this moment execution in step 4,
Step 4: judge whether remainder bytes is complete; If, execution in step 5; Execution in step 6 if not;
Step 5: show the described data that read at described portable terminal;
Step 6: show the data that do not comprise described remainder bytes in the described data that read at described portable terminal.
Wherein, step 4 judges that the incomplete method of remainder bytes can be specially:
When the byte number of remainder bytes less than byte number described in the step 1, and its most significant digit is true, then described remainder bytes is imperfect.For example:
When remaining data is 1 byte, and its most significant digit is true (1xxx xxxx), and learn that according to the information of in step 1, obtaining this e-book adopts the GBK coded format, be that its Chinese character takies 2 bytes, illustrate that then remaining data is the part of the symbol of Chinese character or full-shape, represents that promptly remaining data is imperfect;
When remaining data is 2 bytes, its most significant digit is true (1xxx xxxx), and learn that according to the information of in step 1, obtaining this e-book adopts the UTF8 coded format, be that its Chinese character takies 3 bytes, illustrate that then remaining data is the part of the symbol of Chinese character or full-shape, represents that promptly remaining data is imperfect.
When remaining data is imperfect, when showing the e-book content according to the electronic book data that reads, described portable terminal shows the data that do not comprise described remainder bytes in the data that read, the file pointer at end that can be by will pointing to the electronic book data that reads back moves 1 byte (e-book adopts the GBK coded format) or 2 bytes (e-book adopts the UTF8 coded format) according to coding mode, does not promptly show incomplete remaining data.
Another preferred embodiment of the method for a kind of displaying electronic book with movable terminal of proposition of the present invention is to have comprised step on the basis of aforementioned preferred embodiments:
Read the data of described e-book when described step 2 after, judge that whether described size of data is zero, if, represent then that e-book has been read to finish, finish this method flow; If not, then continue execution in step 3.
The another preferred embodiment of the method for a kind of displaying electronic book with movable terminal of proposition of the present invention is to comprise step on the basis of aforementioned preferred embodiments: show electronic book data in described step 3 after, whether the data of judging described e-book all read, if, representing then that e-book has been read finishes, and finishes this method flow; If not, then return execution in step 2.Here, can judge whether the data of e-book all show by judging the end whether current file pointer has pointed to the e-book total data.
The present invention determines each character by the electronic book data that reads is word for word saved land, and whether can represent a complete character to judge remainder bytes, if then all show; If not, then incomplete remainder bytes can not shown.Therefore, the user is when each reading electronic book content, and decline can mess code not occur because of the partial bytes that reads character, has therefore improved user's reading experience.
Though; the present invention clearly demonstrates by above embodiment and accompanying drawing thereof; yet under the situation that does not deviate from spirit of the present invention and essence thereof; the person of ordinary skill in the field works as can make various corresponding variations and correction according to the present invention, but these corresponding variations and correction all should belong to the protection domain of claim of the present invention.
Claims (10)
1. the method for a displaying electronic book with movable terminal is characterized in that, comprising:
Step 1: obtain the coded format that is stored in e-book in the described portable terminal, obtain the shared byte number of each Chinese character;
Step 2: the data that read described e-book;
Step 3: according to coded format described in the step 1, the byte-by-byte character of determining that described data comprise;
Step 4: judge whether remainder bytes is complete, if then show the described data that read at described portable terminal; If not, show the data that do not comprise described remainder bytes in the described data that read at described portable terminal.
2. method according to claim 1 is characterized in that, the byte-by-byte character of determining that described data comprise is specially in the described step 3:
When data to be determined be 1 byte and its most significant digit for false, or the byte number of data to be determined equals the described byte number in the step 1, and its most significant digit is true time, just is defined as a character.
3. method according to claim 1 is characterized in that, the incomplete determination methods of remainder bytes described in the described step 3 is specially:
When the byte number of remainder bytes less than byte number described in the step 1, and its most significant digit is true, then described remainder bytes is imperfect.
4. method according to claim 1 is characterized in that, described step 2 also comprises step after reading the data of described e-book: judge whether described size of data is zero, if then finish; If not, execution in step 3 then.
5. method according to claim 1 is characterized in that, also comprises step after the described step 4: whether the data of judging described e-book all show, if then finish; If not, then return execution in step 2.
6. the device of a displaying electronic book with movable terminal is characterized in that, comprising:
Obtain information module, be used for obtaining the coded format that is stored in described portable terminal e-book, obtain the shared byte number of each Chinese character;
The reading of data module is used to read the data of described e-book;
Determine character module, be used for the described coded format of obtaining information module according to described, the byte-by-byte character of determining that described data comprise;
First judge module is used to judge whether remainder bytes is complete;
Display module is used for showing described data at portable terminal, and when remainder bytes is imperfect, shows the data that do not comprise described remainder bytes in the described data.
7. want 6 described devices according to right, it is characterized in that, described definite character module specifically is used for:
When data to be determined be 1 byte and its most significant digit for false, or the byte number of data to be determined equals the described described byte number that obtains in the information module, and its most significant digit is true time, just is defined as a character.
8. device according to claim 6 is characterized in that, described judge module specifically is used for:
When the byte number of remainder bytes less than the described described byte number that obtains in the information module, and its most significant digit is true time, then described remainder bytes is imperfect, otherwise described remainder bytes is complete.
9. device according to claim 6 is characterized in that, also comprises second judge module, is used to judge whether the described size of data of described reading of data module is zero.
10. device according to claim 6 is characterized in that, also comprises the 3rd judge module, is used to judge that whether described display module all shows the data of described e-book, if then finish; If not, then continue to read the data of described e-book by described reading of data module.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009102123950A CN101702149B (en) | 2009-11-12 | 2009-11-12 | Method for displaying electronic book with movable terminal and device thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009102123950A CN101702149B (en) | 2009-11-12 | 2009-11-12 | Method for displaying electronic book with movable terminal and device thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101702149A true CN101702149A (en) | 2010-05-05 |
CN101702149B CN101702149B (en) | 2012-07-18 |
Family
ID=42157065
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2009102123950A Expired - Fee Related CN101702149B (en) | 2009-11-12 | 2009-11-12 | Method for displaying electronic book with movable terminal and device thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101702149B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101937312A (en) * | 2010-09-15 | 2011-01-05 | 中兴通讯股份有限公司 | Method for marking electronic book and mobile terminal |
CN102314413A (en) * | 2010-07-06 | 2012-01-11 | 上海闻泰电子科技有限公司 | Electronic-book skipping and positioning method for mobile terminal |
CN102456056A (en) * | 2010-11-01 | 2012-05-16 | 阿里巴巴集团控股有限公司 | Information output method and information output device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101059800A (en) * | 2006-04-21 | 2007-10-24 | 上海晨兴电子科技有限公司 | Method and apparatus for displaying electronic book on mobile phone |
CN101364216B (en) * | 2008-09-22 | 2011-05-11 | 中兴通讯股份有限公司 | Method and device for displaying electronic book documentary on mobile terminal |
-
2009
- 2009-11-12 CN CN2009102123950A patent/CN101702149B/en not_active Expired - Fee Related
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102314413A (en) * | 2010-07-06 | 2012-01-11 | 上海闻泰电子科技有限公司 | Electronic-book skipping and positioning method for mobile terminal |
CN101937312A (en) * | 2010-09-15 | 2011-01-05 | 中兴通讯股份有限公司 | Method for marking electronic book and mobile terminal |
WO2012034303A1 (en) * | 2010-09-15 | 2012-03-22 | 中兴通讯股份有限公司 | Method for marking electronic book and mobile terminal |
CN101937312B (en) * | 2010-09-15 | 2014-03-19 | 中兴通讯股份有限公司 | Method for marking electronic book and mobile terminal |
CN102456056A (en) * | 2010-11-01 | 2012-05-16 | 阿里巴巴集团控股有限公司 | Information output method and information output device |
CN102456056B (en) * | 2010-11-01 | 2013-07-03 | 阿里巴巴集团控股有限公司 | Information output method and information output device |
Also Published As
Publication number | Publication date |
---|---|
CN101702149B (en) | 2012-07-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104281827B (en) | Identify the method and device of Quick Response Code | |
CN101364216B (en) | Method and device for displaying electronic book documentary on mobile terminal | |
CN102883059B (en) | The display method and apparatus of note, the method and apparatus of answer short message | |
EP1852785A3 (en) | Method and device for selecting a word to be defined in mobile communication terminal having an electronic dictionary | |
CN1964533B (en) | Mobile communication terminal and link management method of the same | |
CN103167167A (en) | Mobile terminal and extraction method of communication contact person information | |
US20130311589A1 (en) | Method and apparatus for adding recipient information | |
CN101526963A (en) | Method for identifying web page coding, device and terminal equipment | |
CN103544954A (en) | Method and device for adding text label to voice message | |
CN101202976A (en) | Apparatus and method of mobile communication terminal character conversion | |
CN103870799A (en) | Character direction judging method and device | |
JPWO2009028555A1 (en) | Electronic device, character string display method, multiple character string sort method, and character string display / sort program | |
CN106649617B (en) | Method for analyzing data structure of Windows Phone short message | |
CN101702149B (en) | Method for displaying electronic book with movable terminal and device thereof | |
CN101600025A (en) | The method and apparatus of assessing news website by mobile terminal | |
CN101951427A (en) | System and method for acquiring information of contact person | |
US20100107044A1 (en) | System and method for defining layout of an electronic business card | |
CN101945350A (en) | Timing communication method and device for mobile terminal and mobile terminal | |
CN104281560B (en) | Display method, device and terminal of memory text information | |
CN104104781B (en) | A kind of method and device showing SIM cards of mobile phones contact person | |
CN103220390A (en) | Method and terminal for marking newest contact ways of contacts | |
CN103428341A (en) | Method and device for searching for mobile phone contacts | |
EP2535802A1 (en) | Computer-implemented method of arranging text items in a predefined order | |
CN102014191A (en) | System and method for acquiring contact names | |
CN104581660A (en) | Method of handling SMS messages and related communication system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120718 Termination date: 20131112 |