Click here to Skip to main content
16,005,162 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionstreamreader functionality Pin
pbaggett27-Feb-06 4:07
pbaggett27-Feb-06 4:07 
AnswerRe: streamreader functionality Pin
Guffa27-Feb-06 4:17
Guffa27-Feb-06 4:17 
GeneralRe: streamreader functionality Pin
pbaggett27-Feb-06 4:34
pbaggett27-Feb-06 4:34 
AnswerRe: streamreader functionality Pin
Guffa27-Feb-06 6:27
Guffa27-Feb-06 6:27 
GeneralRe: streamreader functionality Pin
pbaggett27-Feb-06 7:59
pbaggett27-Feb-06 7:59 
AnswerRe: streamreader functionality Pin
Guffa27-Feb-06 9:29
Guffa27-Feb-06 9:29 
GeneralRe: streamreader functionality Pin
pbaggett27-Feb-06 10:30
pbaggett27-Feb-06 10:30 
AnswerRe: streamreader functionality Pin
Guffa27-Feb-06 13:00
Guffa27-Feb-06 13:00 
pbaggett wrote:
FYI, the encoding of a PKZIP file is apparently UTF8


No, it's definitely not. The PKZIP format is a binary format, not a text format, so it doesn't have any encoding. Also, the PKZIP format (1989) predates the Uncode standard (1991).

What you have done is to interpret the binary data as ASCII (which it isn't) and converted it to Unicode. The ASCII encoding only support character codes 0-127, so if you successfully decoded the file, you were just lucky to have a file where all the bytes happened to be in that range. You must have used a very small file, for this is not normal for compressed files.

The bytes that you handled as ASCII and converted to Unicode is in the asciiBytes array (so it's not at all ASCII bytes, but Unicode bytes). Then you decode the Uncode data as if it was ASCII and place it in the asciiChars array. The only reason this doesn't turn the data into total garbage, is that you were lucky again, and none of the "characters" did become a multi-byte code in Unicode.

Sorry to say it, but your code does at best virtually nothing at all. When used with most compressed files it will totally mangle the data, though.

Back to the drawing board. You still have to find out how the string that you send will be decoded.

---
b { font-weight: normal; }

JokeRe: streamreader functionality Pin
pbaggett28-Feb-06 3:14
pbaggett28-Feb-06 3:14 
GeneralRe: streamreader functionality Pin
Guffa28-Feb-06 8:52
Guffa28-Feb-06 8:52 
GeneralRe: streamreader functionality Pin
pbaggett1-Mar-06 4:39
pbaggett1-Mar-06 4:39 
QuestionRun Time Text Box Pin
Nadeem Akhter27-Feb-06 4:00
Nadeem Akhter27-Feb-06 4:00 
Questiondatabase engine for larg application Pin
illusionFinder27-Feb-06 2:46
illusionFinder27-Feb-06 2:46 
AnswerRe: database engine for larg application Pin
Colin Angus Mackay27-Feb-06 2:57
Colin Angus Mackay27-Feb-06 2:57 
GeneralRe: database engine for larg application Pin
illusionFinder27-Feb-06 3:07
illusionFinder27-Feb-06 3:07 
GeneralRe: database engine for larg application Pin
Colin Angus Mackay27-Feb-06 3:20
Colin Angus Mackay27-Feb-06 3:20 
AnswerRe: database engine for larg application Pin
Guffa27-Feb-06 3:38
Guffa27-Feb-06 3:38 
Questionpc can see its self on network without network Pin
illusionFinder27-Feb-06 2:44
illusionFinder27-Feb-06 2:44 
QuestionWeird problem with the Body of a MailMessage Pin
dlarkin7727-Feb-06 2:38
dlarkin7727-Feb-06 2:38 
QuestionMouse Cursor....... Pin
daviiie27-Feb-06 2:32
daviiie27-Feb-06 2:32 
AnswerRe: Mouse Cursor....... Pin
illusionFinder27-Feb-06 3:04
illusionFinder27-Feb-06 3:04 
AnswerRe: Mouse Cursor....... Pin
Guffa27-Feb-06 4:20
Guffa27-Feb-06 4:20 
Questionvistadb Pin
illusionFinder26-Feb-06 23:37
illusionFinder26-Feb-06 23:37 
AnswerRe: vistadb Pin
Colin Angus Mackay27-Feb-06 0:08
Colin Angus Mackay27-Feb-06 0:08 
QuestionChainz game Pin
ands_226-Feb-06 23:08
ands_226-Feb-06 23:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.