![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Text File Unreadable Codes Hi All: When using FSO Open a Text File(UTF-8 WITHOUT BOM Encoding) is Miscoding, but ANSI encoding and UTF-8 LITTLE ENDIAN Text File is Ok. Can Somebody Tell Why? Need I use ADO to convert encoding? ------------------------------------------------ ?佄呃偙?呈?倠??????????????吠慲獮瑩潩慮????瑨汭?敨摡?敭慴栠瑴?煥極??湯整瑮吭灹≥挠湯整瑮∽整瑸栯浴?挠慨獲瑥甽晴???琼瑩敬堾極整???骼?讀???迥?飦鶔????琯瑩敬?楬歮栠敲?栢瑴???桰瑯?畸瑩?敮?瑳瑡捩瀯牯慴?獣?*剾D∽瑳汹獥敨瑥?祴数∽整瑸振獳??氼湩?*睍垺赚挒?猯瀮潨潴砮極整渮瑥猯慴楴?敨摡*皰A?敲?猢祴敬桳敥?琠灹?琢硥?獣???捳楲瑰氠湡畧条?樧癡獡*疄?琠灹?琧硥?慪慶捳楲瑰?*?栧瑴???桰瑯?畸瑩?敮?瑳瑡捩猯*疄公B*橯?獪??捳楲瑰?潮捳楲瑰?????袠闥??癡卡*疄?触? .... ------------------------------------------------ My Code like thie: strFile = "a.txt" Set objFSO = CreateObject("Scripting.FileSystemObject") Set oFile = objFSO.OpenTextFile(strFile, 1, false, -1) colLines = oFile.ReadAll oFile.Close Wscript.Echo colLines .... Thanks! |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Text File Unreadable Codes "Buddy" <qinfengbin@newsgroup> wrote in message news:O5inPzTTKHA.764@newsgroup Quote: > Hi All: > > When using FSO Open a Text File(UTF-8 WITHOUT BOM Encoding) is Miscoding, > but ANSI encoding and UTF-8 LITTLE ENDIAN Text File is Ok. Can Somebody > Tell Why? Need I use ADO to convert encoding? > > ------------------------------------------------ > > ?佄呃,?呈?,I?""?"'b-攥o?Y▇O??o-吭z痢菽觨-∽整瑉-朐?挠慨獲瑥甽晴???琼"敬?@~O整???骼?讀???迥?飦'????琯"敬?~Hsm-咔?-喱o???-I瑍?畸"?"?><捩z"牯'b?.? > ">D∽>汹-"?<数∽整瑉振獳??s頾? > .^∽'z?猯zf漮潴砮~O整oz瑥猯'b~N?"" > 'A?敲?猢<敬-L"?琠z?琢??.???'諂L瑰s醥Y甞条?~装V" > 畓?琠z?琧??'Y'c'諂L瑰? ?-瀣o???-I瑍?畸"?"?><捩猯 > 畓公B>*TQ?猳??'諂L瑰?潮'諂L瑰?????衺闥??癡卡 畓?触? > ... > > ------------------------------------------------ > > My Code like thie: > > strFile = "a.txt" > Set objFSO = CreateObject("Scripting.FileSystemObject") > Set oFile = objFSO.OpenTextFile(strFile, 1, false, -1) > colLines = oFile.ReadAll > oFile.Close > > Wscript.Echo colLines > ... > > Thanks! |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Text File Unreadable Codes It perform ok in notepad.exe . "Pegasus [MVP]" <news@newsgroup> 写入消息新闻:u6AjTrVTKHA.2836@newsgroup Quote: > What does a.txt look like when opened with notepad.exe? |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Text File Unreadable Codes "Buddy" <qinfengbin@newsgroup> wrote in message news:uqjQkaWTKHA.764@newsgroup Quote: > It perform ok in notepad.exe . - The first few lines you see on the screen when running this command: debug c:\Buddy.txt - The script you use to read the file. |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Text File Unreadable Codes Re Pegasus: Thanks! I do not know how to upload file in this forum, so I upload to rayfile. The url is : http://www.rayfile.com/files/68522ff...-0014221b798a/ Please look at it. "Pegasus [MVP]" <news@newsgroup> 写入消息新闻:ui1$LjWTKHA.5164@newsgroup Quote: > "Buddy" <qinfengbin@newsgroup> wrote in message > news:uqjQkaWTKHA.764@newsgroup Quote: >> It perform ok in notepad.exe . > I'm sure it does but you need to post more information, e.g. > - The first few lines you see on the screen when running this command: > debug c:\Buddy.txt > - The script you use to read the file. > |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Text File Unreadable Codes "Buddy" <qinfengbin@newsgroup> wrote in message news:%23W72iqXTKHA.2836@newsgroup Quote: > Re Pegasus: > > Thanks! > > I do not know how to upload file in this forum, so I upload to rayfile. > The url is : > > http://www.rayfile.com/files/68522ff...-0014221b798a/ > > Please look at it. batch file below, then copy & paste the information into your reply: @echo off echo > c:\debug.scr D 100 300 echo >>c:\debug.scr Q debug c:\buddy.txt < c:\debug.scr > c:\debug.txt notepad c:\debug.txt |
My System Specs![]() |
| | #7 (permalink) |
| | Re: Text File Unreadable Codes Maybe I'm misunderstanding, but isn't that behavior what you would expect? Your code specifies opening the file as unicode, which is a 2-byte-per-character system. UTF-8 uses 1-4 bytes per character. So if you open the file as unicode, without having any BOM, wouldn't it make sense that it would be corrupted? Also, if you're using a Chinese codepage then I think your equivalent of ASCII text will actually be DBCS text, so that's an extra complication. I don't know how much Windows can do to second-guess whether unmarked text in not ASCII, but I do know that FSO filters the text based on the local codepage. Quote: > > When using FSO Open a Text File(UTF-8 WITHOUT BOM Encoding) is Miscoding, > but ANSI encoding and UTF-8 LITTLE ENDIAN Text File is Ok. Can Somebody Quote: > Why? Need I use ADO to convert encoding? > > ------------------------------------------------ > > ???琼"敬?@~O整???骼?讀???迥?飦'????琯"敬?~Hsm-咔?-喱o???-I瑍? 畸"?"?><捩z"牯'b?.? ">D∽>汹-"?<数∽整瑉振獳??s頾? .^∽'z?猯zf漮潴砮~O整oz瑥猯'b~N?"" 'A?敲?猢<敬-L"?琠z?琢??.???'諂L瑰s醥Y甞条?~装V" 畓?琠z?琧??'Y'c'諂L瑰? ?-瀣o???-I瑍?畸"?"?><捩猯 畓公B>*TQ?猳??'諂L瑰?潮'諂L瑰?????衺闥??癡卡 畓?触? Quote: > ... > > ------------------------------------------------ > > My Code like thie: > > strFile = "a.txt" > Set objFSO = CreateObject("Scripting.FileSystemObject") > Set oFile = objFSO.OpenTextFile(strFile, 1, false, -1) > colLines = oFile.ReadAll > oFile.Close > > Wscript.Echo colLines > ... > > Thanks! > > |
My System Specs![]() |
| | #8 (permalink) |
| | Re: Text File Unreadable Codes Re Pegasus: I've bees trying the batch code.I think it does't work. So I upload again to filefactory: http://www.filefactory.com/file/a0hh855/n/e_7z My be you can download form here.The result of the batch code: ------------------------------------ - D 100 300 138C:0100 3C 21 44 4F 43 54 59 50-45 20 48 54 4D 4C 20 50 <!DOCTYPE HTML P 138C:0110 55 42 4C 49 43 20 22 2D-2F 2F 57 33 43 2F 2F 44 UBLIC "-//W3C//D 138C:0120 54 44 20 48 54 4D 4C 20-34 2E 30 31 20 54 72 61 TD HTML 4.01 Tra 138C:0130 6E 73 69 74 69 6F 6E 61-6C 2F 2F 45 4E 22 3E 3C nsitional//EN">< 138C:0140 68 74 6D 6C 3E 3C 68 65-61 64 3E 3C 6D 65 74 61 html><head><meta 138C:0150 20 68 74 74 70 2D 65 71-75 69 76 3D 22 43 6F 6E http-equiv="Con 138C:0160 74 65 6E 74 2D 54 79 70-65 22 20 63 6F 6E 74 65 tent-Type" conte 138C:0170 6E 74 3D 22 74 65 78 74-2F 68 74 6D 6C 3B 20 63 nt="text/html; c 138C:0180 68 61 72 73 65 74 3D 75-74 66 2D 38 22 20 2F 3E harset=utf-8" /> 138C:0190 3C 74 69 74 6C 65 3E 58-75 69 74 65 20 E7 9B B8 <title>Xuite .... 138C:01A0 E7 B0 BF EF BC 9A E6 AF-8F E5 80 8B E4 BA BA E9 ................. 138C:01B0 83 BD E5 8F AF E4 BB A5-E6 98 AF E6 94 9D E5 BD ................. 138C:01C0 B1 E5 A4 A7 E5 B8 AB 3C-2F 74 69 74 6C 65 3E 3C ........</title>< 138C:01D0 6C 69 6E 6B 20 68 72 65-66 3D 22 68 74 74 70 3A link href="http: 138C:01E0 2F 2F 73 2E 70 68 6F 74-6F 2E 78 75 69 74 65 2E //s.photo.xuite. 138C:01F0 6E 65 74 2F 73 74 61 74-69 63 2F 70 6F 72 74 61 net/static/porta 138C:0200 6C 2E 63 73 73 22 20 72-65 6C 3D 22 73 74 79 6C l.css" rel="styl 138C:0210 65 73 68 65 65 74 22 20-74 79 70 65 3D 22 74 65 esheet" type="te 138C:0220 78 74 2F 63 73 73 22 20-2F 3E 3C 6C 69 6E 6B 20 xt/css" /><link 138C:0230 68 72 65 66 3D 22 68 74-74 70 3A 2F 2F 73 2E 70 href="http://s.p 138C:0240 68 6F 74 6F 2E 78 75 69-74 65 2E 6E 65 74 2F 73 hoto.xuite.net/s 138C:0250 74 61 74 69 63 2F 68 65-61 64 65 72 2E 63 73 73 tatic/header.css 138C:0260 22 20 72 65 6C 3D 22 73-74 79 6C 65 73 68 65 65 " rel="styleshee 138C:0270 74 22 20 74 79 70 65 3D-22 74 65 78 74 2F 63 73 t" type="text/cs 138C:0280 73 22 20 2F 3E 3C 73 63-72 69 70 74 20 6C 61 6E s" /><script lan 138C:0290 67 75 61 67 65 3D 27 6A-61 76 61 73 63 72 69 70 guage='javascrip 138C:02A0 74 27 20 74 79 70 65 3D-27 74 65 78 74 2F 6A 61 t' type='text/ja 138C:02B0 76 61 73 63 72 69 70 74-27 20 73 72 63 3D 27 68 vascript' src='h 138C:02C0 74 74 70 3A 2F 2F 73 2E-70 68 6F 74 6F 2E 78 75 ttp://s.photo.xu 138C:02D0 69 74 65 2E 6E 65 74 2F-73 74 61 74 69 63 2F 73 ite.net/static/s 138C:02E0 63 72 69 70 74 73 2F 6D-6F 6A 6F 2E 6A 73 27 3E cripts/mojo.js'> 138C:02F0 3C 2F 73 63 72 69 70 74-3E 3C 6E 6F 73 63 72 69 </script><noscri 138C:0300 70 p - Q ------------------------------------ "Pegasus [MVP]" <news@newsgroup> 写入消息新闻:OeXUPWZTKHA.2836@newsgroup Quote: > Sorry, I am unable to download anything from this site. You could run the > batch file below, then copy & paste the information into your reply: > > @echo off > echo > c:\debug.scr D 100 300 > echo >>c:\debug.scr Q > debug c:\buddy.txt < c:\debug.scr > c:\debug.txt > notepad c:\debug.txt |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Convert hostname text file to IP text file | VB Script | |||
| Howto: Add lines of text from a specific point in a text file.. | VB Script | |||
| the file or directory C: is corrupt or unreadable, please run chkd | Vista General | |||
| the file or directory is corrupted and unreadable!!!!!!!!!!!!!!! | Vista General | |||
| HELP! the file or directory is corrupted and unreadable | Vista music pictures video | |||