Problem with chinese fileNames inside a zipfile

Hi all
I have a really strange problem . I needed to create a zip file(English name) and add a chinese file to that Zip . I had done this using java.uti.zip and in the output zip file i am seeing a totally different chiense name than what i had expected . My code looks like this
String fileName = "������";(Chinese fileName)
File zipFile = new File("abc.txt");
ZipOutputStream zipOutStrm = null;
BufferedInputStream in = null;
try
int length = 0;
byte[] buffer = new byte[2048];
zipOutStrm = new ZipOutputStream(new FileOutputStream("abc.zip"));
ZipEntry zipe = new ZipEntry(fileName);
zipOutStrm.putNextEntry(zipe);
in = new BufferedInputStream(new FileInputStream(zipFile));
length = in.read(buffer);
while(length != -1)
zipOutStrm.write(buffer, 0, length);
length = in.read(buffer);
catch(FileNotFoundException e)
e.printStackTrace();
catch(IOException e)
e.printStackTrace();
finally
try
in.close();
zipOutStrm.closeEntry();
zipOutStrm.close();
catch(Exception e)
//do nothing ;
Later i found out from the sun site that there is some encoding issues with the way java does the zip and winZip encoding .
Can any one let me know how to come out of this ??

The file name encoding issue with ZIP is basically: The encoding of file names in ZIP-files is not specified and when non-ASCII file names came along each and every zip-utility solved it in a different way, some did not solve it at all, some store it in ISO-8859-1 (= no chinese), some store it in UTF-8 (I think Java does this), others might have other strategies ...
So if there is a way to not use non-ASCII characters in your zip-files you greatly enhance the portability of your programm.

Similar Messages

  • Flash Player 9 problem with Chinese language

    Flash Player 9 problem with Chinese language
    I have developed a course in flash which goes in to different
    languages like Spanish, Chinese, Portuguese, Japanese...
    I have used flash for developing the course. I have tested it
    for Chinese It looks great on flash player 6,7 and 8 but I am
    shocked to see that it give some garbage value in flash player 9.
    Don’t know this is a bug of player or what?
    Flash Player 9 Problem
    Flash Player 9 problem with Chinese language
    Flash Player
    9 problem with Chinese language

    Thanks for the helpful posting. I came searching here for advice because I could not get my Flash Player 9 installation to succeed using the trouble-shooting information provided on the Adobe web site, and from experience I have come to know that my best resource in trouble-shooting is to seek the help of other Mac users.
    In following your instructions I discovered that "Enable Flash" was not checked in my preferences, so that was definitely part of the problem. However, I still could not get Flash Player 9 to work, so after doing a Google search I found a posting on Version Tracker (under feedback at the bottom of this page: http://www.versiontracker.com/dyn/moreinfo/macosx/11622 ) that provided the last little bit of instruction I needed to get Flash Player 9 to function properly.
    Before attempting to install Flash Player 9 I had used Adobe's uninstaller to uninstall previous versions, as instructed on the Adobe website. However, AFTER repairing my disk permissions, I needed to restart the computer and run the uninstaller again. After uninstalling I restarted once more, ran the installer and, VOILA!, finally Flash Player 9 worked as it should.
    PowerBook (1.5 GHz PowerPC G4)   Mac OS X (10.4.8)  

  • Problems with Chinese characters

    I have a client experiencing 3 distinct problems with their Chinese-localized Fm files:
    The SimSun TTF font used in the source Fm files is "uninstalling" itself. This requires reinstallation of the font on a regular basis (every few days).
    The colons used in index markers in the Fm source files are not being parsed as Level1IX, Level2IX, etc. in the RoboHelp project. Instead, they are recognized as colons. In other words, the first level marker in Rh is XXXXXXXX:XXXXXXX:XXXXXXX. The same is true for the semicolons.
    The conversion settings for the Chinese project do not allow for mapping to individual CSS elements and classes. This means that all of the formatting is controlled via the supplemental CSS generated from the FrameMaker formatting. IOW, the formatting all uses the class="FM_ definitions.
    Has anyone had success working with Chinese characters in a FrameMaker to RoboHelp workflow (either linking or importing)?
    Anyone else seen any of these issues in Chinese or any other fonts?
    I'm thinking the first two issues are likely due to the TrueType font used, but can't find an Adobe OTF SimSans font to use as a replacement.
    However, the lack of mapping capability in the conversion process is a stumper...perhaps due to the double-byte font itself.
    Any thoughts or solutions are greatly appreciated by my client (whose deadline passed yesterday!)
    -Matt

    I dont think you can print chinese chars at the console on window
    to print the character codes to the console use someting like that
    char [] chars = request.getParameter("whatever").toCharArray()
    for(each chars){
    System.out.println((int)chars);
    then check if you got the corresponding chinese char

  • [internationalization] problems with Chinese characters

    Hi everybody.
    I'm working on a program and i'd like to translate it into several languages. Until now I've managed to launch my program in 3 languages : French, English and German. I do it by asking the user which language he'd like to select by means of a JComboBox. Then the right Locale is selected and the right text is called by the RessourceBundle and so on .... Actually I've encountered no problems with "latin lettered" languages.
    I also tried to introduce Chinese in my program and that's how problems come in. The way Chinese is introduced in the program is exactly the same that of French, English and German. The .properties file I use is MyRessourcesMainTitle_zh.properties and one line is stored in it: title = 中文
    However when I run the program and selected Chinese as language an error pops up in the DOS console : "Exception in thread "AWT-EventQueue-0" java.util.MissingRessourceException : Can't find ressource for bundle java.util.PropertyRessourceBundle, key title".
    I would like to point out that I saved my *.properties in a former *.txt file encoded in Unicode. Saving it encoded either in Unicode big endian or in UTF8 ends with the same problem. However the program ran just fine when I encoded it in ANSI but it's worthless insofar as the Chinese characters are transformed into "?".
    Would anyone have an idea about how to implement sucessfully Chinese characters in my program ?

    I dont think you can print chinese chars at the console on window
    to print the character codes to the console use someting like that
    char [] chars = request.getParameter("whatever").toCharArray()
    for(each chars){
    System.out.println((int)chars);
    then check if you got the corresponding chinese char

  • Problem with building array inside a case statement

    I have a problem with my build array.
    Iam trying to construct a build array when ever I see a new element in my parent array during run time.
    Using shift registers, search array and If- case structure, inside a while loop. Iam implementing this logic (I dont want to use Event structure).
    Iam able to achieve most part of it, but have a problem with the first element. Except the first element of my parrent array, every thing is appending in to the build array. Can any one look at my vi and suggest me what Iam doing wrong here.
    Thank you
    Attachments:
    debug.vi ‏12 KB

    I think you need to replace the tunnels (carrying the array) in the for loop with a shift register.
    Lynn

  • Problems with Chinese Display

    I have a Java application whose menus and other text varies according to the locale. So far I have a default properties file for English and a zh_CN.properties file for Simplified Chinese. When I run the application on Chinese Windows XP, Chinese text displays fine. When I try to run the same app on English Windows XP by typing
    java -jar QD.jar zh CN
    from the command line, I just get boxes instead of Chinese characters. This in spite of the fact that I installed XP's East Asian Language support (via the Control Panel), which includes MingLiu & PMingLiu, MS Hei, SimHei, SimSum & NSimSum, etc.
    Based on what I have been reading on this forum, it seems that I may need to explicitly set the font on the components that needs to display Chinese. But this seems odd: Aren't Java components smart enough to figure out that if they need to display Chinese, they should pick a font that is able to do so? How is Java able to display Chinese correctly with Chinese Windows XP if not without this very logic?
    Btw, I am running 1.4.1 on both my English and my Chinese boxes.

    Hi Edward,
    you're quite right. You will need to set the font explicitly everywhere to get this to work. Java can't pick a font for you going by locale. I'm not quite sure why this is, but I could take a guess. I know the I18N guys have repeated fits about fonts at Sun - I'm pretty sure they'd have to individually load each font at VM init time, and check whether each font has the full and correct set of glyphs onboard. That's a very time-consuming process for the VM to get up to, I'd think. Maybe they're just saving processor time.
    Either way, there's a good reason that it works on Chinese XP and not English XP. Java's default font is whatever the OS sets it to be. Chinese XP's default font is likely to be something like MingLiU, though I'm not entirely sure. It can certainly display Chinese anyway. English XP I believe defaults to Tahoma, which cannot display Chinese. Hence, you're getting the rectangles when running off Java's default font under the English version.
    I have absolutely no idea how to change the default font for XP (not sure if this is even possible), so setting the font explicitly by name usually wins out. :-(
    Hope that helps!
    Martin Hughes

  • Safari has problem downloading gmail attachment with chinese filenames

    When using safari download attachments in gmail, the downloaded filenames are corrupted. all Chinese characters changed to ?
    For example ???.doc

    Same issue here! Unsolved after YEARS of this issue.
    I dig through the downloads folder and paste a copied file name at least 15 times a day.
    And Mountain Lion was supposed to be a big push for Chinese language users. Still a fail.
    Really want to be a Safari supporter - would love to see this solved, Apple.

  • Problem with chinese character for dot matrix epson LQ-1600K III

    Hi All,
    I really runs out of idea about my problem now. The problem is about Print Chinese character to dot matrix printer (Epson LQ-1600K III). I tried to so many device type to solve this issue, looks like the only device type can be use are CNSAPWIN and CNEPSON with CNSONG font type. The others if I print to the printer, the chinese character became # (although in the print preview it`s okay and display correctly).
    Here is the bottleneck if I use CNEPSON:
    - if I have 2 window at the left and right position, if the left window has chinese character, the right window automatically shift right about 1.5 CM, which is damn weird!!! Can somebody help me
    - I tried so many ways to adjust the line size for my detail window (to cater positioning at pre-printed boxes), but looks the font size always become 10pt and line size cannot be adjustable (based on smartstyle).BUT if I used device type epescp2, it can be done!
    Here is the bottleneck if I use CNSAPWIN:
    - I need to create format type in windows and SAP (SPAD). and every PC that use this printer, must define the Paper size ( China Special paper size 12inch)
    - I also think this is not a good idea because as I far as I know this is not the correct way..
    Therefore, if somebody has experience about printer chinese character to dot matrix for Smartform and sapscript..please kindly help me give some advice.
    Do I use the wrong device type?
    Thanks in advance!
    Regards,
    Willy

    Hi friends , we are using the same model ....
    Are you using the chinese version operation system ? because we can print the chinese charaters without problem in LQ 1600KIII .....
    We are using CNSAPWIN device type + Frondend printing access method ....
    Carlos Zhang

  • Problem with Input help inside an adobe interactive forms

    Hi Experts,
    I'm currently implementing a Webdynpro ABAP application containing a Interactive forms.
    I'm using Adobe Live Cycle Designer 8.0, Acrobat reader 9.2, Internet Explorer 7.0
    My problem is that when I click on the "input help" button inside the adobe form, he automatically refresh all the forms UI element with their initial values. Is-it a refresh event included when we pressed the "Input help" button or an other event? How Can I deactivate that action, event?
    Because since he automatically refresh my form data I loose the context current values.
    Thanks in advance,
    Louis

    P740741 wrote:>
    > Hi Norbert,
    >
    > Thanks for reply, yes I use ZCI and I inserted the Webdynpro script  through Utilities.
    >
    > Best Regards,
    > Louis
    strange, but you could compare the version of the zci scripting
    in your form in the hierarchy tab there are variables and the ContainerFoundation_JS script --> the first line
    // DO NOT MODIFY THE CODE BEYOND THIS POINT - xxxxxxxxxxxxxxxxxxxxxxxxxxx - ContainerFoundation_JS gives you the requested information about the scripting version...have a look at this version...
    norbert
    perhaps this note helps:
    Note 999998 - Analyzing errors with Adobe Integration of Web Dynpro ABAP
    --> for debugging!
    A client debug function is available as of SAP NetWeaver Release 7.00 Support Package 19 (or after you implement Note 1287114) and for all Enhancement Packages. Activate this client debug function using the URL parameter "sap-wd-clientDebug=X" (attach it to the URL using "&"). You can then activate the client trace using the key combination <CTRL><ALT><SHIFT>T (move the focus to a Web Dynpro UI element, for example, to an InputField, do NOT move the focus to Adobe Reader). The system opens a new browser window with the trace output. The trace may contain an error entry ("Network Error", and so on). The URL also activates the Adobe document services (ADS) trace. The trace outputs of the ADS are copied to the generated PDF document as an attachment. Open the file "Error.pdf" of the ADS trace: Form errors (for example, script errors) are listed there.
    Edited by: Norbert Prager on Oct 24, 2009 7:31 PM

  • Problem with long filenames in packaging processes

    Hi,
    I have a quick question regarding packaging processes of Thinapps. I'm sure others have the same issues too, but it is not much info on it on the interweb.
    certain application have alot of subfolders in program files etc. when the developers made the application they did not go over the 255 NTFS filename limit. but when working with the virtual filesystem we get additional subfolders. This makes it difficult to move project folders etc.
    Does any have some fix on this issue other than using subst command everytime for each folder?

    We use Thinapp 5.1.
    We already change the location but, but when storing the project folder on a share we cant avoid getting additional sub directories. The developers for all applications take this into account when they get the same problem in their development environments.
    If Thinapp had not used ANSI codes that has a limit of 260 path length. then I dont think that it would an issue. Support case?
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/fbad33ee-b10b-4ab8-9370-a2af017ca46b/maximum-folders-in-a-folder-in-ntfs

  • Problem with chinese characters while sending mail with .CSV attachment

    Hi,
    i am sendin .CSV file as an attachment with mail using "SO_DOCUMENT_SEND_API1" FM,
    whle opening the mail attachment the chinese characters are not displaying properly.
    currently i am using ECC 5.0
    can any body help in this regard.
    Thanks,
    Rahim

    Hi Kang Ring,
    please convert the content of the attachement into the binary format and then add it as a mail attachment.
    LOOP AT i_data ASSIGNING <wa_data>.
    if s_output is INITIAL.
    CONCATENATE <wa_data> cl_abap_char_utilities=>cr_lf into s_output.
    else.
    CONCATENATE s_output <wa_data> INTO s_output SEPARATED BY cl_abap_char_utilities=>cr_lf.
    endif.
    ENDLOOP.
    CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
    EXPORTING
    text = s_output
    IMPORTING
    buffer = x_output.
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
    buffer = x_output
    TABLES
    binary_tab = imail_att.
         OR
    please use ABAP-Object classes like CL_BCS , CL_document_BCS.....
    please findthe below sample code.
      cl_bcs_convert=>string_to_solix(
              EXPORTING
                iv_string   = s_output
                iv_codepage = '4103'          "suitable for MS Excel, leave empty
                iv_add_bom  = 'X'               "for other doc types
              IMPORTING
                et_solix  = s_output_binary  "(of type solix_tab)
                ev_size   = size ).
    attachment->add_attachment(                       "attachment of type ref to cl_document_bcs
              i_attachment_type    = 'xls'                     
              i_attachment_subject = l_subject    
              i_attachment_size    = size
              i_att_content_hex    = s_output_binary ).
    you need to write the code for adding the receipents, subject and adding this "attachment " as an attachment to the mail.
    Hope this will helps to you....,
    thanks,
    Rahim.

  • Strange problem with audio (link inside)

    Hello Community, please help me!
    So I started this project where I film everything I do in the year 2014 and stuff.
    Well, this week I began with doing the work in AE, so far so good.
    I'm not finished yet, but I just wanted to try to render and upload it, for testing reasons. (with bad quality though) here's the link: https://vimeo.com/113597439
    So... apparently there's every 11 seconds this clacking sound, I don't know how to get rid of it, it looks like it's a problem I have with AE rendering, because I tried to screencapture it and then convert it with the same software as I did with the AE outcome, it was fine. (but I obviously can't get a HD outcome by screencapturing my RAM-Preview). So it's not my converting tool!
    And I don't know what it is and additionally, the sound is getting delayed, I'm not sure if it's because of the same reason the clacking sound is, because in my RAM-Preview everything is perfectly fine.
    I'm using lossless with Audio checked on.
    I would be super thankful if anybody could help!
    Thanks in advance.

    So I'm not hearing anything funky on my phone when watching the video. I do have one question though, this looks like a bunch of clips strung together with nothing special added to the clips so I'm wondering why you are using AE to EDIT when AE is a compositing and motion graphics application specifically designed to create short shots or sequences. I would do something like this in Premiere Pro. It will take you about 1/10 the time and it will render much faster.

  • Problem with resultset.next inside 817 DB

    I have a java class running inside 817 database.
    I have a prepared statement that gets some records and loops through them and writes a record into another table.
    The SQL statement should produce 3000 records but only 566 get logged in the loop.
    I have looked at/tried everything. NOTHING seems wrong but jus tI dont get alll the records. The datatset is not truncated, records are missing ramdomly throught, ie recs 1-4 are OK then 5,6,7 are missing etc..
    Anyone know what the prb might be, its really weird and driving me nuts
    Rob
    null

    thank you for the pointers.
    For the RS is empty I've done a check with
    if(selectRs.next()!=null), even though
    next() is never suppose to be null, Yeah, you needn't bother with that. It's never supposed to be null, and if it is, there's a bug in the executeQuery method.
    ?so that confuses
    me. I've also put Sys.outs before & after the if
    statement & found it never prints out the System.out
    after the if(rs.next()). & I've stepped
    through with my WAS Debugger as a last restort to see
    what's going on. :$ So you're saying you put a print statement as the first statement right inside if (rs.next()) and it didn't get executed?
    I did do as you suggested with the
    count(*) & it did return a count of 1.You did that in your Java code? Changing only what you're selecting from those couple of columns to count(*), leaving the from and where alone?
    I am catching the SQLException for the try but
    nothing for the
    a_ruleSyntax.equals(current_ruleSyntax).Not sure what you're saying here, and not sure what your catch block looks like.
    I have put a System.out for if the equals returns
    false.
    Do you have any other ideas?Nope, sorry.
    If your answers to my questions above are "yes, that's what I'm doing," then I'm out of ideas, unless there's some exception that you're smothering.

  • Problem with Accordion Widget INSIDE Sliding Panel Widget

    Hello,
    perhaps I should not do this, but I nested an Accordion
    Widget inside a Sliding Panels Widget:
    - There are eight Panels.
    - Each one contains a complete Accordion.
    The sliding works fine, and so does the Accordion animation,
    but the text inside the Accordion Panel Tabs won't move along, when
    a tab is activated. I need to hover the mouse over the accordion to
    make the panel texts appear again.
    Of course, when I un-nest the widgets and move the Accordion
    widget out of the Sliding Panel widget, everything is fine.
    My question is:
    - am I demanding "too much" by nesting the widgets?
    - or should this basically work, and the problem arises from
    rivalling scripts?
    Here is a link:
    Nested
    widgets Test
    The horizontal top menu will activate the sliding panels, but
    as of now only the leftmost menu item contains an Accordion (I know
    the CSS does not look nice yet).
    Is there anything I can optimise to get this to work?
    Thank you so much,
    Greetings, Jensen
    Edit: The problem does NOT occur in Firefox, but in
    Safari.

    Hi John,
    That is the expected behavior if the "Overlap items below" is unchecked. Please refer to the following link http://screencasteu.worldsecuresystems.com/aish/2013-08-21_1947.png. If you don't want the page to wiggle up and down, please check the box shown in the screenshot.
    Regards,
    Aish

  • Powershell 4.0: Problem with error handling inside Eventhandlers - Powershell has stopped working

    Hallo!
    Please see the attached sample code. This code simply show a small WPF-Dialog.
    Test 1 (showing the problem)
    Simply run the program. You will see Powershell crashing "Powershell has stopped working".
    The cause of this is the devision by 0 inside the Eventhandler.
    We would normally expect, that the exception should be handled by the trap.
    Test 2 (showing normal operation)
    Simply remove the comment in line 28 ($i=1/0).
    This activates an exception outside the Eventhandler. Now the Trap will be executed normally.
    --> The exception can be handled by the Powershell Devloper.
    Can anybody help? Why does the Error management via Trap not work inside Eventhandlers?
    Thanks for some assistance and ideas!
    Regards
    Heike
    cls
    Set-StrictMode -Version 4.0
    $ErrorActionPreference = "stop"
    Add-Type -Assemblyname PresentationFramework
    # -- Eventhandler - will be fired during form load -----------------------------------------------------
    $FormLoaded = {
    Write-Host "EventHandler is running..."
    # Problem:
    # All exceptions will crash Powershell.
    # We would normally expect that the Global Trap will be executed!
    # This problem occurs inside of Eventhandlers only!
    # TEST 1 --> Create an Exception (Division by 0) --> Powershell crashes: "Powershell_ISE has stopped working"
    $i=1/0
    # -- End of Eventhandler----------------------------------------------------------------------------------
    # -- Start of Demo-Programm ------------------------------------
    Write-Host "Start Demo"
    # -- TEST 2 ---
    # Write-Host "Test 2: Testing Global Trap"
    # Create an Exception (Division by 0) --> Powershell does not crash --> Global Trap will be executed --> OK
    # $i=1/0
    # XAML-Code for WPF-Dialog
    [xml]$xaml = @"
    <Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Test - " Height="370" Width="657" ResizeMode="NoResize" WindowStyle="ThreeDBorderWindow" WindowStartupLocation="CenterScreen" ShowInTaskbar="False" >
    <Grid Margin="0,0,0,-4">
    <Label Name="CustomerName" Content="Hello World" HorizontalAlignment="Left" Margin="10,2,0,0" VerticalAlignment="Top" Width="596"/>
    </Grid>
    </Window>
    $Form1=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $xaml)) # Load form
    Write-Host "Register Event"
    $Form1.Add_Loaded($FormLoaded)
    Write-Host "Starting ShowDialog"
    $Form1.ShowDialog() > $null
    Write-Host "End of program"
    # Global Trap - all exceptions should be handled here
    trap{
    Write-host "Global Trap is running..."
    Write-host "End of trap - program will be stopped"

    It works fine if you don't try to execute the code while loading and if you use a better exception handling method.
    Add-Type -Assemblyname PresentationFramework
    [xml]$xaml=@'
    <Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Test - " Height="370" Width="657" ResizeMode="NoResize" WindowStyle="ThreeDBorderWindow" WindowStartupLocation="CenterScreen" ShowInTaskbar="False" >
    <Grid Margin="0,0,0,-4">
    <Label Name="CustomerName" Content="Hello World" HorizontalAlignment="Left" Margin="10,2,0,0" VerticalAlignment="Top" Width="596"/>
    </Grid>
    </Window>
    $Form1=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $xaml)) # Load form
    $Form1.Add_Loaded({
    Write-Host "EventHandler is running..."
    Try{
    $i=1/0
    Catch{
    Write-Host "$_"
    $Form1.ShowDialog()
    ¯\_(ツ)_/¯

Maybe you are looking for

  • Issue with Auto PO creation

    Hello Gurus, Kindly help me with this issue. I have user who is using ME59 for the auto PO creation.When he runs this transaction with the "TEST RUN" flaged,in the result screen he is able to see a mesasage as "PO creation successfull" along with the

  • Compressing 91 mins to MPEG2

    I've read similar questions, but not sure of the answer still. I've got a 90 min 42 sec movie I'm trying to get to DVD Studio Pro. From FCP I'm using the compressor set at "Best Quality 16:9 for 90 min", I'm also having the audio done (omf and ac3) a

  • Music disapears with itunes 10.6

    Since I updates to 10.6 when I put music on my Iphone it is real spotty. If i try to add more than i file at a time one of them disapears. It is really frustrating

  • When I select Toolbar-Customize and the options box opens, the Navigation Bar icons disappear.

    Two questions: 1) When I select Toolbar, then Customize, the box with the toolbar options opens, but my Navigation bar icons disappear, so I can't add the spaces, bars, etc. to it. How do I fix that? 2) I can reposition the icons in the Navigation ba

  • Apple Id Security Questions Problem

    how to reset security questions,though i didnt get any link to send a mail to rescue E mail id Pls Help