SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

adding files with unicode names to zip file [vb 2005]

Last post 08-10-2016 7:19 AM by DIVYA. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 11-09-2006 11:52 PM

    adding files with unicode names to zip file [vb 2005]

    hi ..

    iam trying to zip some document files with arabic names into one zip file ..

    the code is working well, but when adding the files to the zip file, it changes the names of the document files to some strange chars,


    is there anyway to correct this problem !?

    thank you ..


    p.s: if i tried the bzip2 code it works well, so it adds the file to the .bz file with the correct file names, but i didn`t manage to rewrite the code to zip more than one file ..anyone can help me please ?:)
     here`s the code :

    Dim fsInputFile As FileStream, fsBZ2Archive As FileStream
                fsInputFile = File.OpenRead(txtFileName.Text) ' how to read a second file let`s say it is in txtfilename2.text  to add it to bz?
                fsBZ2Archive = File.Create(txtFileName.Text + ".bz")
                BZip2.Compress(fsInputFile, fsBZ2Archive, 4026)
                fsInputFile.Close()

  • 11-10-2006 11:00 AM In reply to

    Re: adding files with unicode names to zip file [vb 2005]

    Hi,

    The difference is that with BZip2 you arent storing the filenames as part of the compressed output.  Its stored as part of the operating system filename which is different.  Why is it different? Because Zip files store names for entries within the file itself and they arent stored as unicode as the OS ones are (assuming XP/2K etc).

    The key to this is the codepage in use when converting to / from names for entries in the archive.

    There is a property in ZipConstants called DefaultCodePage which controls this.  This controls the Encoding that is used to do the conversion.  One value to try might be 720, which is one form of arabic. Another is 864, 702.

    You can check on your machine in the advanced panel of regional and language options from the control panel to see which code pages are installed on your machine.

    You can also try downloading and running the program AEX using the command line AEX --showenv and seeing what it says.  The current thread OEM page is a good value to try, assuming your machine is set up as an arabic one.

    hth, -jr-

     

  • 11-10-2006 12:28 PM In reply to

    Re: adding files with unicode names to zip file [vb 2005]

    hi ..

    thanks john i got it now, and it`s working ..

    i just found this table with some codepages with their references ..hope they become helpful ..

    thanks again john :)

     from : http://www.asphelper.de/referenz/codepage.asp

     

    CodepageNameZeichensatz
    037EBCDICEBCDIC
    1200Unicode, 16-bit encodingutf-16
    1201Unicode (FEFE)Unicode (Big Endian)
    1230Windows-1230Zentral-Europäisches Alphabet (Windows)
    1250OsteuropaWindows-1250
    1251Kyrillischiso-8859-5, Windows-1251, cp866, ibm866
    1252ANSIiso-8859-1, Windows-1252
    1253Griechischiso-8859-7, Windows-1253
    1254Türkischiso-8859-9, Windows-1254
    1255Hebräischiso-8859-8, Windows-1255
    1256Arabischiso-8859-6, Windows-1256
    1257Baltischiso-8859-4, Windows-1257
    1258VietnamesischWindows-1258
    20127USA (ASCII)ASCII
    20866Kyrillisch (KOI8-R)koi8-r
    21866Ukrainisch (KOI8-RU)koi8-ru
    28592Zentraleuropa (ISO)iso-8859-2, latin2
    28592Zentral Europäisches Alphabet (ISO)iso-8859-2
    28593Latin 3-Alphabet (ISO)iso-8859-3
    28594Baltisches Alphabet(ISO)iso-8859-4
    28595Kyrillisch (ISO)iso-8859-5
    28596Arabisch (ISO)iso-8859-6
    28597Griechisch (ISO)iso-8859-7
    500EBCDIC (500V1)EBCDIC (500V1)
    50220Japanisch (JIS)iso-2022-jp
    50221Japanisch (JIS-Allow 1 Byte Kana)csISO2022JP
    50222Japanisch (JIS-Allow 1 Byte Kana)iso-2022-jp
    50225Koreanisch (ISO)iso-2022-kr
    65000Unicode, 7-bit encodingutf-7
    65001Unicode, 8-bit encodingutf-8
    852Zentral Europa (DOS)ibm852
    862Hebräisch (DOS)dos-862
    874Thailändischiso-8859-11, Windows-874, DOS-874, TIS-620, x-EBCDIC-Thai
    932IBM EBCDIC 
    932Japanischiso-2022-jp, euc-jp, csISO2022JP
    936Chinesisch (Einfach)iso-ir-58, gb2312, csISO58GB231280, GB_2312-80, csGB2312
    949Koreanischiso-ir-149, euc-kr, KSC5601, ks_c_5601, ks_c_5601-1987, csKSC56011987
    950Chinesisch (Traditionell, Standard)big5, csbig5, x-x-big5

     

  • 11-10-2006 4:07 PM In reply to

    Re: adding files with unicode names to zip file [vb 2005]

    hi again ,

    john, i checked your small aex tool ... very handy, iam trying to get the same values in my vb .net project so i can encode the file name in a correct mode ..

    so will you please tell me what exactly those values are ?

    if i run your aex application i get this information on my system :

    current encoding is : Arabic (dos) , code page 720, windows code page is 1256

    .....

    ....

    ....

    i just want to ask the 720 is what exactly, iam working on vb .net and it`s only giving me the 1256 as code page back ..so what exactly is the 720(which is the correct encoding)

     

    thanks anyway ..

    (for others having the same problem here`s the code for getting codepage on vb 2005)

    System.Text.Encoding.Default.EncodingName

    System.Text.Encoding.Default.CodePage


     

  • 11-10-2006 11:01 PM In reply to

    Re: adding files with unicode names to zip file [vb 2005]

    Hi,

    Go back to http://www.geocities.com/licamft/ and download AEX again.  I have included the source code so you can see what its doing to get the information.

    hth, -jr-

  • 11-10-2006 11:03 PM In reply to

    Re: adding files with unicode names to zip file [vb 2005]

    Hi,

    And another thing is that the current 0.85 version uses what is more likely to be a better default value already, so you could download that and try it out.

    hth, -jr-

     

  • 07-27-2009 1:29 PM In reply to

    Re: adding files with unicode names to zip file [vb 2005]

     Hello,

    I read your posts, and I think I am facing a similar problem as yours but still I can't fix it and I need some assistance...

    I am using SharpZipLib to create zip file... However, when a folder inside the Zip file has Arabic name, its name becomes "????" which causes errors when I try to extract the zip file...

    In fact I am using FastZip object to create my zip file...and I really find it difficult to change the way I am creating this zip file...So, I tried changing in the SharpZipLib code "changing DefaultCodePage to Encoding.UTF8 or Encoding.GetEncoding(any of the numbers mentioned in your post) but none worked fine, actually the "???" just changed to special characters and that enabled the zip file to be extracted. However, I still need the folder inside to have a correct name...

    Can you please help me with that?

  • 08-10-2016 7:19 AM In reply to

    • DIVYA
    • Not Ranked
    • Joined on 08-10-2016
    • Posts 1

    Re: adding files with unicode names to zip file [vb 2005]

    I am also facing the same problem as yours but still I can't fix it. Please explain me clearly to solve.

    Thank you

Page 1 of 1 (8 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.