CN102662924A - Method for solving incompatibility problem in character set transmission from PC to Android system based on hybrid coding - Google Patents
Method for solving incompatibility problem in character set transmission from PC to Android system based on hybrid coding Download PDFInfo
- Publication number
- CN102662924A CN102662924A CN2012100679831A CN201210067983A CN102662924A CN 102662924 A CN102662924 A CN 102662924A CN 2012100679831 A CN2012100679831 A CN 2012100679831A CN 201210067983 A CN201210067983 A CN 201210067983A CN 102662924 A CN102662924 A CN 102662924A
- Authority
- CN
- China
- Prior art keywords
- character string
- coding
- ansi
- path
- windows
- 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.)
- Pending
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention provides a method for solving incompatibility problem in character set transmission from a PC to an Android system based on hybrid coding. When a file in a first path information of the windows system of the PC is transmitted to a second path information of the Android system of a handheld device through an USB interface, the first path and the second path are coded into character strings respectively by using ansi coding and utf-8 coding, and the character strings are transmitted to an Android DebugBridge driver. The driver only identifies Chinese in the ansi when running in the windows system to search commands, so that the first path is intercepted firstly and transmitted to the windows system for processing, the utf-8 coded second path is transmitted as is to the Android system, and the Android system performs file creation in the second path according to a file stream form of file content and file name. According to the invention, the incompatibility problem in the character set transmission from the PC to the Android system is solved by using the hybrid coding.
Description
[technical field]
The present invention relates to the communication apparatus technical field, relate in particular to and a kind ofly solve PC to the tall and erect system transmissions character set incompatible method of peace based on hybrid coding.
[background technology]
The system of a lot of handheld mobile devices all is the tall and erect android of a peace system in the market; When using handheld mobile device, the user often all can be connected with PC; Thereby its be for manage on the handheld mobile device application program or through is connected the saving flow of surfing the Net with PC, will have the situation of carrying out interaction data between windows system and the An Zhuo system of PC like this.
The windows system of general PC and the An Zhuo system of handheld mobile device carry out interaction data through AndroidDebug Bridge (the tall and erect debugging of peace bridge) driver; And the windows system of PC carry out the operation of some files after acquiescence use the character set of ansi coding form to preserve; For example: write one section word with notepad, the content of this notepad file is to preserve with the character set of ansi coding form; And the android system is based on its file acquiescence of the system research and development of linux and uses the character set of utf-8 coding form to preserve; When PC system and android system use AndroidDebug Bridge driver to communicate like this; The character of transmission byte can not go wrong; But crossing is civilian; Will occur during the multibyte character of other non-English such as Japanese: the phenomenon of mess code can appear on the An Zhuo system of mobile device the time in the file transfer of writing in the PC system, and the most frequent situation is exactly the order that the file of transmission Chinese name causes the user usually can't directly carry out containing Chinese.General a string character set just exists with a kind of coding form; As: utf-8 coding or ansi coding etc.; And the Android Debug Bridge driver in the windows of PC system is when the processing character collection; The character of the first intercepting ansi coding of meeting handles for the windows system, and remaining coded character partly can directly handle for the An Zhuo system.At present, transmitting the file of Chinese name, generally is two kinds of methods:
One, make file into English name earlier, carry out the PUSH command transfer through Android Debug Bridge driver again, after the end of transmission (EOT), change back original title again.Such shortcoming is trouble, need rename, and also needs transfer files name information.
Two, do not use Android Debug Bridge driver to carry out the PUSH command transfer, directly use the socket transfer files.Such shortcoming is, has abandoned the packaged file transmitting function of Android Debug Bridge driver, be in PC the function of the document flow among the own designing treatment socket.
[summary of the invention]
The technical matters that the present invention will solve is to provide a kind of and solves PC to the tall and erect system transmissions character set incompatible method of peace based on hybrid coding, promptly incompatiblely is: when the transmission character collection, the phenomenon of mess code in the An Zhuo system, occurs.
The present invention is achieved in that and a kind ofly solves PC to the tall and erect system transmissions character set incompatible method of peace based on hybrid coding, comprises the steps:
The command interpreter of step 30, windows system is given to this order the Android Debug Bridge driver of installing under the windows system; Driver finds the content of filename and this document name of first character string of ansi coding to be transferred to said USB interface with the form of document flow, and second character string that utf-8 encodes is directly passed to USB interface;
After the An Zhuo system of step 40, said handheld device receives the data stream in the USB interface; Second character string according to the coding of the utf-8 in the data stream is created second path; Filename according to first character string of the ansi in data stream coding is created this document name under second path of the said establishment of An Zhuo system; And the content of the filename of first character string of ansi coding stored in the filename of establishment, thereby accomplish the transmission of file.
The present invention has following advantage: Android Debug Bridge driver is installed in the PC system, and driver is only accepted ansi or unicode coding, and for compatibility; The present invention selects this byte coding of ansi; Rather than this multibyte of unicode coding, the character set encoding that then will transmit becomes the coding of ansi and two kinds of byte of the utf-8 Android Debug Bridge driver of throwing to, and this driver operates among the windows; During search directory; Only discern the ansi coding, then the order line of windows system is formed the order line of hybrid coding, promptly the windows system wants in first path of transfer files; Use the ansi coding, because this path is used for to driver search windows; The utf-8 coding is used in second path that will be transferred to the purpose ground of An Zhuo system then, and driver can be this path tall and erect android of peace system of in statu quo throwing to; The An Zhuo system creates file according to the file content and the filename of the document flow form under first path under second path.The present invention uses hybrid coding to solve the incompatible problem that the PC system occurs when the tall and erect system transmissions character set of peace, and with the USB interface transmission, transmission speed is fast, is not easy to make mistakes.
[description of drawings]
Fig. 1 is the inventive method schematic flow sheet.
Fig. 2 is the principle of work block diagram of one embodiment of the invention.
[embodiment]
As shown in Figure 1, of the present inventionly a kind ofly solve PC to the tall and erect system transmissions character set incompatible method of peace based on hybrid coding, comprise the steps:
The command interpreter of step 30, windows system is given to this order the Android Debug Bridge driver of installing under the windows system; Driver finds the content of filename and this document name of first character string of ansi coding to be transferred to said USB interface with the form of document flow, and second character string that utf-8 encodes is directly passed to USB interface;
After the An Zhuo system of step 40, said handheld device receives the data stream in the USB interface; Second character string according to the coding of the utf-8 in the data stream is created second path; Filename according to first character string of the ansi in data stream coding is created this document name under second path of the said establishment of An Zhuo system; And the content of the filename of first character string of ansi coding stored in the filename of establishment, thereby accomplish the transmission of file.
As shown in Figure 2, below in conjunction with a specific embodiment the present invention is described further.
Suppose that file position in the windows of PC system is c :/Chinese .txt; Some contents have been write in this Chinese .txt file; Existing it is passed to mobile device through USB interface pacify in the tall and erect android system; And the path is set under the An Zhuo system is/sdcard/, promptly file will be kept under this path/sdcard/.
In the program of windows system with c :/Chinese .txt is encoded into first character string with ansi, and general/sdcard/ is encoded into second character string with utf-8; And the order line of giving the windows system: Adb push (the ansi coding of file_from_win) (the utf-8 coding of file_to_android); If the ansi of file_from_win is encoded to c :/Chinese .txt; The utf-8 of file_to_android is encoded to/sdcard/, then forms one " Adbpush c :/Chinese .txt/sdcard/ " order line, and the windows system is passed in this order.The command interpreter of windows system is given to this order the Android Debug Bridge driver of installing under the windows system; Driver finds the content of Chinese .txt (being filename) and this document name of first character string of ansi coding to be transferred to said USB interface with the form of document flow, and second character string/sdcard/ that utf-8 is encoded directly passes to USB interface.After the An Zhuo system of said handheld device receives the data stream in the USB interface; Second character string/sdcard/ according to the coding of the utf-8 in the data stream creates second path; Filename Chinese .txt according to first character string of the ansi in data stream coding creates this document name under second path of the said establishment of An Zhuo system, at this moment the Chinese .txt of formation/sdcard/ under the An Zhuo system; And the content of the filename of first character string of ansi coding stored in the filename of establishment, thereby accomplish the transmission of file.
The present invention comprises ansi and utf-8 coding simultaneously in a string character set, use hybrid coding to solve the incompatible problem that the PC system occurs when the tall and erect system transmissions character set of peace, and with the USB interface transmission, transmission speed is fast, is not easy to make mistakes.
The above is merely preferred embodiment of the present invention, and all equalizations of doing according to claim of the present invention change and modify, and all should belong to covering scope of the present invention.
Claims (1)
1. one kind solves PC to the tall and erect system transmissions character set incompatible method of peace based on hybrid coding, it is characterized in that: comprise the steps:
Step 10, be transferred to one second routing information following time under the tall and erect android of the peace system of handheld device through USB interface when the file under one first routing information in the windows of the PC system; Then in the windows system filename under first routing information and this routing information is being encoded into first character string with ansi; Second routing information is encoded into second character string with utf-8;
Step 20, the order line that first character string and second character string are transferred to the windows system form the order of " Adb push first character string second character string ", and the windows system is passed in this order;
The command interpreter of step 30, windows system is given to this order the Android Debug Bridge driver of installing under the windows system; Driver finds the content of filename and this document name of first character string of ansi coding to be transferred to said USB interface with the form of document flow, and second character string that utf-8 encodes is directly passed to USB interface;
After the An Zhuo system of step 40, said handheld device receives the data stream in the USB interface; Second character string according to the coding of the utf-8 in the data stream is created second path; Filename according to first character string of the ansi in data stream coding is created this document name under second path of the said establishment of An Zhuo system; And the content of the filename of first character string of ansi coding stored in the filename of establishment, thereby accomplish the transmission of file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012100679831A CN102662924A (en) | 2012-03-14 | 2012-03-14 | Method for solving incompatibility problem in character set transmission from PC to Android system based on hybrid coding |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012100679831A CN102662924A (en) | 2012-03-14 | 2012-03-14 | Method for solving incompatibility problem in character set transmission from PC to Android system based on hybrid coding |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102662924A true CN102662924A (en) | 2012-09-12 |
Family
ID=46772419
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2012100679831A Pending CN102662924A (en) | 2012-03-14 | 2012-03-14 | Method for solving incompatibility problem in character set transmission from PC to Android system based on hybrid coding |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102662924A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102999568A (en) * | 2012-11-09 | 2013-03-27 | 北京京东世纪贸易有限公司 | Method and device for displaying list on mobile terminal |
CN105263195A (en) * | 2015-09-23 | 2016-01-20 | 努比亚技术有限公司 | Data transmission device and method |
CN104079453B (en) * | 2014-07-07 | 2018-05-18 | 苏州佳世达电通有限公司 | The enumeration methodology and device of commissioning device |
CN111629020A (en) * | 2019-12-03 | 2020-09-04 | 蘑菇车联信息科技有限公司 | Remote input method, device, PC (personal computer) terminal, android device and system |
CN114172897A (en) * | 2021-12-09 | 2022-03-11 | 西安邮电大学 | PC (personal computer) end and Android end file transmission method and system |
-
2012
- 2012-03-14 CN CN2012100679831A patent/CN102662924A/en active Pending
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102999568A (en) * | 2012-11-09 | 2013-03-27 | 北京京东世纪贸易有限公司 | Method and device for displaying list on mobile terminal |
CN102999568B (en) * | 2012-11-09 | 2016-06-15 | 北京京东世纪贸易有限公司 | A kind of method and apparatus showing list on mobile terminals |
CN104079453B (en) * | 2014-07-07 | 2018-05-18 | 苏州佳世达电通有限公司 | The enumeration methodology and device of commissioning device |
CN105263195A (en) * | 2015-09-23 | 2016-01-20 | 努比亚技术有限公司 | Data transmission device and method |
CN105263195B (en) * | 2015-09-23 | 2018-11-02 | 努比亚技术有限公司 | Data transmission device and method |
CN111629020A (en) * | 2019-12-03 | 2020-09-04 | 蘑菇车联信息科技有限公司 | Remote input method, device, PC (personal computer) terminal, android device and system |
CN114172897A (en) * | 2021-12-09 | 2022-03-11 | 西安邮电大学 | PC (personal computer) end and Android end file transmission method and system |
CN114172897B (en) * | 2021-12-09 | 2023-08-25 | 西安邮电大学 | Method and system for transmitting files of PC (personal computer) end and Android end |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102662924A (en) | Method for solving incompatibility problem in character set transmission from PC to Android system based on hybrid coding | |
EP1571557A1 (en) | A method of sending command and data to movable storage device | |
US10043220B2 (en) | Method, device and storage medium for data processing | |
CN101174954A (en) | Document breaking point uploading method based on internet hypertext transfer protocol | |
EP0807890A3 (en) | Text string extraction system | |
CN101895572B (en) | Data interaction method and system between SD card and main control equipment | |
CN100454307C (en) | Method for completely crashing file data in FAT roll | |
CN101385015B (en) | Shell sessions | |
CN101251838A (en) | Method and system for grammatical analysis of demixing marking document | |
CN102520792A (en) | Voice-type interaction method for network browser | |
CN107566455B (en) | Charging pile wireless communication system and communication method | |
BRPI0513389A (en) | communication method and system | |
CN104142851A (en) | Method for using computer input method in android simulator | |
CN104077289A (en) | Method for realizing Web multi-language switching | |
CN103793321B (en) | application program detection method and system | |
CN104917826A (en) | Method for accessing FTP (File transfer protocol) in heterogeneous environment in automatic code conversion mode | |
CN108304358A (en) | Based on the land data analysis method of inertial navigation product SDCard storage devices | |
CN103617113A (en) | File version displaying method based on time axis | |
CN106020946A (en) | Virtual machine migration method | |
CN102546732A (en) | File transmission method and system in webpage | |
CN102929559B (en) | Method and system for providing file | |
TW201635187A (en) | Cross-platform electronic document and signed data integration method and system | |
CN102419643A (en) | Method and system for remotely entering words based on cloud computing | |
CN105847328B (en) | Carry out data transmission interactive method to Http agreement based on QTP | |
CN102647458A (en) | Method for displaying various files in a cell phone mobile office system with B (Browser)/S (Server) structure |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20120912 |