CN101702149B - 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 PDF

Info

Publication number
CN101702149B
CN101702149B CN2009102123950A CN200910212395A CN101702149B CN 101702149 B CN101702149 B CN 101702149B CN 2009102123950 A CN2009102123950 A CN 2009102123950A CN 200910212395 A CN200910212395 A CN 200910212395A CN 101702149 B CN101702149 B CN 101702149B
Authority
CN
China
Prior art keywords
data
byte
book
bytes
determined
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.)
Expired - Fee Related
Application number
CN2009102123950A
Other languages
Chinese (zh)
Other versions
CN101702149A (en
Inventor
张宗楚
韦晓飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Wuju Technology Co Ltd
Original Assignee
Shenzhen Wuju Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Wuju Technology Co Ltd filed Critical Shenzhen Wuju Technology Co Ltd
Priority to CN2009102123950A priority Critical patent/CN101702149B/en
Publication of CN101702149A publication Critical patent/CN101702149A/en
Application granted granted Critical
Publication of CN101702149B publication Critical patent/CN101702149B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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

A kind of method and apparatus of displaying electronic book with movable terminal
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) 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 through using the WAP service on net.
In the prior art, the user need show e-book through 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 is merely 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
To 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 said portable terminal, obtain the shared byte number of each Chinese character;
Step 2: the data that read said e-book;
Step 3: according to coded format described in the step 1, the byte-by-byte character of confirming that said data comprise;
Step 4: judge whether remainder bytes is complete, if, the said data that then read in said mobile terminal displays; If not, the data that in the said data that said mobile terminal displays reads, do not comprise said remainder bytes.
Preferred as technique scheme, the byte-by-byte character of confirming that said data comprise is specially in the said 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 said byte number in the step 1, and its most significant digit is true time, just confirms as a character.
Preferred as technique scheme, the incomplete determination methods of remainder bytes described in the said 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 said remainder bytes is imperfect.
Preferred as technique scheme, said step 2 also comprise step after reading the data of said e-book: judge whether said size of data is zero, if then finish; If not, execution in step 3 then.
Preferred as technique scheme, also comprise step after the said step 4: whether the data of judging said 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 said 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 said e-book;
Confirm character module, be used for the said coded format of obtaining information module according to said, the byte-by-byte character of confirming that said data comprise;
First judge module is used to judge whether remainder bytes is complete;
Display module is used in the said data of mobile terminal displays, and when remainder bytes is imperfect, shows the data that do not comprise said remainder bytes in the said data.
Preferred as technique scheme, said 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 said said byte number that obtains in the information module, and its most significant digit is true time, just confirms as a character.
Preferred as technique scheme, said judge module specifically is used for:
When the byte number of remainder bytes less than the said said byte number that obtains in the information module, and its most significant digit is true time, then said remainder bytes is imperfect, otherwise said remainder bytes is complete.
Preferred as technique scheme also comprises second judge module, is used to judge whether the said size of data of said reading of data module is zero.
Preferred as technique scheme also comprises the 3rd judge module, is used to judge that whether said display module all shows the data of said e-book, if then finish; If not, then continue to read the data of said e-book by said reading of data module.
The present invention confirms each character through 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 can incomplete remainder bytes 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, specific embodiments of the invention is done further to specify.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 obvious.
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
The preferred embodiment of the device of a kind of mobile terminal displays compressed format picture that below proposes for the present invention; As shown in Figure 1; Comprise: obtain information module 101, reading of data module 102, confirm 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 said 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 said e-book;
Confirm that character module 103 is used for the said coded format of obtaining information module according to said, the byte-by-byte character of confirming that said data comprise;
First judge module 104 is used to judge whether remainder bytes is complete;
Display module 105 is used for video data, and when remainder bytes is imperfect, shows the data that do not comprise said remainder bytes in the said data.
Wherein, Said 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 said said byte number that obtains in the information module, and its most significant digit is true time, just confirms as a character.
Said first judge module 104 specifically is used for: when the byte number of remainder bytes less than the said said byte number that obtains information module, and its most significant digit is true time, then said remainder bytes is imperfect, otherwise said remainder bytes is complete.
In the above-described embodiments, also comprise second judge module, be used for whether the said said size of data of judging that said reading of data module 102 reads is zero.
Can also comprise the 3rd judge module, be used to judge that whether said display module 105 all shows the data of said e-book, if then finish; If not, then continue to read the data of said e-book by said 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 is as shown in Figure 2, comprising:
Step 1: obtain the coded format that is stored in e-book in the said 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 said 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 confirming that said data comprise;
Here; If for the first time show the e-book content, the data that file pointer is pointed to read begin part most, then; Progressively moving hand comes the byte-by-byte character that comprises confirmed; If be not for the first time to show the e-book content, then the current location from file pointer begins, and progressively moving hand comes the byte-by-byte character that comprises confirmed.The method of confirming 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 said byte number in the step 1, and its most significant digit is true time, just confirms 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 English, digital or other symbols of half-angle;
Data to be determined are 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 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 in step 1, obtaining 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: the said data that read in said mobile terminal displays;
Step 6: the data that in the said data that said mobile terminal displays reads, do not comprise said remainder bytes.
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 said 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, explain that then remaining data is the part of the symbol of Chinese character or full-shape, representes 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, explain that then remaining data is the part of the symbol of Chinese character or full-shape, representes 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; The data that do not comprise said remainder bytes in the data that said mobile terminal displays read; The file pointer at end that can be through will pointing to the electronic book data that reads toward 1 byte of moved back (e-book adopts the GBK coded format) or 2 bytes (e-book adopts the UTF8 coded format), does not promptly show incomplete remaining data according to coding mode.
Another preferred embodiment of the method for a kind of displaying electronic book with movable terminal of proposition of the present invention is on the basis of aforementioned preferred embodiments, to have comprised step:
Read the data of said e-book when said step 2 after, judge that whether said 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: after in said step 3, showing electronic book data; Whether the data of judging said 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 through judging the end whether current file pointer has pointed to the e-book total data.
The present invention confirms each character through 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 can incomplete remainder bytes 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 through 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 (6)

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 said portable terminal, obtain the shared byte number of each Chinese character;
Step 2: the data that read said e-book;
Step 3: according to coded format described in the step 1, the byte-by-byte character of confirming that said data comprise;
Step 4: judge whether remainder bytes is complete, if, the said data that then read in said mobile terminal displays; If not, the data that in the said data that said mobile terminal displays reads, do not comprise said remainder bytes;
Step 5: whether the data of judging said e-book all show, if then finish; If not, then return execution in step 2;
Wherein, the byte-by-byte character of confirming that said data comprise is specially in the said step 3:
Data to be determined are 1 byte, and its most significant digit is false, and then this data to be determined are English, digital or other symbols of half-angle;
Data to be determined are 2 bytes, and its most significant digit is true, and adopt the GBK coded format according to this e-book of in step 1, obtaining, and then these data to be determined are Chinese character or other SBC cases;
Data to be determined are 3 bytes, and its most significant digit is true, and adopt the UTF8 coded format according to this e-book of in step 1, obtaining, and then these data to be determined are Chinese character or other SBC cases;
Wherein, judge whether complete being specially of remainder bytes in the said step 4:
When the byte number of remainder bytes less than byte number described in the said step 1, and its most significant digit is true, then said remainder bytes is imperfect; Otherwise said remainder bytes is complete.
2. method according to claim 1 is characterized in that, the byte-by-byte character of confirming that said data comprise is specially in the said 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 said byte number in the step 1, and its most significant digit is true time, just confirms as a character.
3. method according to claim 1 is characterized in that, said step 2 also comprises step after reading the data of said e-book: judge whether said size of data is zero, if then finish; If not, execution in step 3 then.
4. 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 said 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 said e-book;
Confirm character module, be used for the said coded format of obtaining information module according to said, the byte-by-byte character of confirming that said data comprise;
First judge module is used to judge whether remainder bytes is complete;
Display module is used in the said data of mobile terminal displays, and when remainder bytes is imperfect, shows the data that do not comprise said remainder bytes in the said data;
The 3rd judge module is used to judge that whether said display module all shows the data of said e-book, if then finish; If not, then continue to read the data of said e-book by said reading of data module.
Wherein, the byte-by-byte character of confirming that said data comprise is specially in said definite character module:
Data to be determined are 1 byte, and its most significant digit is false, and then this data to be determined are English, digital or other symbols of half-angle;
Data to be determined are 2 bytes, and its most significant digit is true, and adopt the GBK coded format according to this e-book of in step 1, obtaining, and then these data to be determined are Chinese character or other SBC cases;
Data to be determined are 3 bytes, and its most significant digit is true, and adopt the UTF8 coded format according to this e-book of in step 1, obtaining, and then these data to be determined are Chinese character or other SBC cases;
Wherein, judge whether complete being specially of remainder bytes in said first judge module:
When the byte number of remainder bytes less than the said said byte number that obtains in the information module, and its most significant digit is true time, then said remainder bytes is imperfect, otherwise said remainder bytes is complete.
5. want 4 described devices according to right, it is characterized in that, said 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 said said byte number that obtains in the information module, and its most significant digit is true time, just confirms as a character.
6. device according to claim 4 is characterized in that, also comprises second judge module, is used to judge whether the said size of data of said reading of data module is zero.
CN2009102123950A 2009-11-12 2009-11-12 Method for displaying electronic book with movable terminal and device thereof Expired - Fee Related CN101702149B (en)

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 CN101702149A (en) 2010-05-05
CN101702149B true 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
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
CN101937312B (en) * 2010-09-15 2014-03-19 中兴通讯股份有限公司 Method for marking electronic book and mobile terminal
CN102456056B (en) * 2010-11-01 2013-07-03 阿里巴巴集团控股有限公司 Information output method and information output device

Citations (2)

* Cited by examiner, † Cited by third party
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
CN101364216A (en) * 2008-09-22 2009-02-11 中兴通讯股份有限公司 Method and device for displaying electronic book documentary on mobile terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
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
CN101364216A (en) * 2008-09-22 2009-02-11 中兴通讯股份有限公司 Method and device for displaying electronic book documentary on mobile terminal

Also Published As

Publication number Publication date
CN101702149A (en) 2010-05-05

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
CN1964533B (en) Mobile communication terminal and link management method of the same
CN103167167A (en) Mobile terminal and extraction method of communication contact person information
CN101202976A (en) Apparatus and method of mobile communication terminal character conversion
US20130311589A1 (en) Method and apparatus for adding recipient information
CN103544954A (en) Method and device for adding text label to voice message
CN101702149B (en) Method for displaying electronic book with movable terminal and device thereof
CN103685734A (en) Multi-type communication integration method and device
CN106649617B (en) Method for analyzing data structure of Windows Phone short message
CN102577334A (en) Method and apparatus for the automatic predictive selection of input methods for web browsers
CN103020291B (en) A kind of identification label and application process thereof
CN101945350A (en) Timing communication method and device for mobile terminal and mobile terminal
CN103002126B (en) Mobile terminal and information receiving processing method for same
CN104104781B (en) A kind of method and device showing SIM cards of mobile phones contact person
CN104281560B (en) Display method, device and terminal of memory text information
CN101193152A (en) Mobile terminal supporting internet access and data processing method for the same
CN101833936A (en) Mobile terminal and method and device for displaying interfaces thereof
CN103220390A (en) Method and terminal for marking newest contact ways of contacts
CN103428341A (en) Method and device for searching for mobile phone contacts
US9544252B2 (en) Compressing and decompressing electronic messages in message threads
CN103777775A (en) Display processing device of input method and display processing method of input method
CN103888528A (en) Implementation method and system of message communication between WeChat terminals and audio terminals
TWI523557B (en) Method of handling sms messages and related communication system
CN1310561A (en) Character display technique

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