• 0

SSH: Unzip and keep files in UTF-8


Question

I have a 1.6GB file that I transferred from HostGator to MediaTemple through wget since it was too large for FTP's speed.

 

Does anyone know the command that will unzip this file and make sure all the files keep their original characters in the file name? I would have thought it was "-U", I'm not sure. 

Link to comment
https://www.neowin.net/forum/topic/1193965-ssh-unzip-and-keep-files-in-utf-8/
Share on other sites

6 answers to this question

Recommended Posts

  • 0

I'm assuming zip is your format based off of what you said:

 

  Quote
-U (obsolete; to be removed in a future release) leave filenames uppercase if created under MS-DOS, VMS, etc. See -L above.

-L convert to lowercase any filename originating on an uppercase-only operating system or file system. (This was unzip's default behavior in releases prior to 5.11; the new default behavior is identical to the old behavior with the -U option, which is now obsolete and will be removed in a future release.) Depending on the archiver, files archived under single-case file systems (VMS, old MS-DOS FAT, etc.) may be stored as all-uppercase names; this can be ugly or inconvenient when extracting to a case-preserving file system such as OS/2 HPFS or a case-sensitive one such as under Unix. By default unzip lists and extracts such filenames exactly as they're stored (excepting truncation, conversion of unsupported characters, etc.); this option causes the names of all files from certain systems to be converted to lowercase. The -LL option forces conversion of every filename to lowercase, regardless of the originating file system.

 

   

EDIT: ugh, this wasn't suppose to be a double post, but I accidentally clicked quote and not edit and made it a separate post :-(

  • 0

I've tried before on another server and it doing a plain unzip on a zip file caused some files to have foreign characters, so I'm guessing -U works, I'm still not sure though. The problem isn't the letters, but the special characters, I wasn't sure if it was because of the Terminal encoding.

  • 0
  On 23/12/2013 at 19:17, Mr.XXIV said:

I've tried before on another server and it doing a plain unzip on a zip file caused some files to have foreign characters, so I'm guessing -U works, I'm still not sure though. The problem isn't the letters, but the special characters, I wasn't sure if it was because of the Terminal encoding.

 

-U is for leaving filenames as upper case if they were created on filesystems that only had uppercase characters. It won't have an affect for special characters. Also, the terminal encoding isn't going to change how the filenames of the archive are created or or extracted. A filename only dependent on the filesystem the file was created on.

 

When you unzip, by default unzip is going to make an attempt to keep the characters as they were on the original filesystem. If characters aren't supported it will do a conversation though. Your best bet is to make sure to not have filenames that aren't compatible between your src and dest filesystems.

  • 0
  On 23/12/2013 at 19:31, snaphat (Myles Landwehr) said:

-U is for leaving filenames as upper case if they were created on filesystems that only had uppercase characters. It won't have an affect for special characters. Also, the terminal encoding isn't going to change how the filenames of the archive are created or or extracted. A filename only dependent on the filesystem the file was created on.

 

When you unzip, by default unzip is going to make an attempt to keep the characters as they were on the original filesystem. If characters aren't supported it will do a conversation though. Your best bet is to make sure to not have filenames that aren't compatible between your src and dest filesystems.

 

It's from CentOS to Ubuntu and the zip is entirely based on WordPress and usually the characters are affected in the uploads folder, so I'm not sure what to guarantee. But the site looks fine right now.

  • 0
  On 23/12/2013 at 19:47, Mr.XXIV said:

It's from CentOS to Ubuntu and the zip is entirely based on WordPress and usually the characters are affected in the uploads folder, so I'm not sure what to guarantee. But the site looks fine right now.

 

I'd imagine both CentOS and Ubuntu would be using variants of ext for a filesystem so I wouldn't think there'd be compatibility issues.

 

Hmm, this sounds like it might just simply be a display only issue then between the systems (the filenames are the same between systems, but the display isn't in terminal). Check that the locales are the same. It'd be in the rc.conf file under LOCALE="...". That could change up the display of utf8 characters.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Patch My PC - Home Updater 5.2.3.0 by Razvan Serea Patch My PC Free is a reliable tool which can quickly check your PC for outdated software. The supported third-party programs include a large number of widely-used applications, including Adobe Reader, Mozilla Firefox, Java, 7-Zip, BleachBit, Google Chrome and many more. Patch My PC Home updater features: Updates over 500 common apps check including portable apps Ability to cache updates for use on multiple machines No bloatware during installations Applications install/update silently by default no install wizard needed Optionally, disable silent install to perform a manual custom install Easy to use user interface Change updated and outdated apps color for color blindness Option to automatically kill programs before updating it Create a baseline of applications if installing on new PC’s Quickly uninstall multiple programs Scan time is usually less than 1 second Set updates to happen on a schedule Skip updates for any application you don’t want to update Suppresses restarts when performing application updates Patch My PC - Home Updater 5.2.3.0 changelog: Startup Manager New tab to manage which apps launch at startup. This helps speed up your boot time and gives you control over what runs in the background. Generate Diagnostic ZIP You can now create a diagnostic ZIP file from the About page. This helps if you need to send logs on our support forum for Home Updater. Remove Portable Apps Right-click any portable app in the App Catalog or Uninstaller page to remove it directly. Applications Added FFmpeg (Full Shared) – Portable Fing G-Helper – Portable IntelliJ IDEA Community Edition K-Lite Basic Codec Pack K-Lite Full Codec Pack K-Lite Standard Codec Pack KeePass Password Safe v1 LibreOffice Help Pack MemTest86 – Portable Nexus Vortex Nvidia Profile Inspector – Portable Pale Moon – Portable ViVeTool – Portable WinCDEmu Windows PC Health Check Wise Video Converter Applications Removed Driver Easy Download: Patch My PC 5.2.3.0 | 54.8 MB (Freeware) Download: Patch My PC Portable | 31.0 MB (Portable) View: Patch My PC Free Homepage | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • "For starters, Microsoft Edge is getting a media control center. This feature is intended to let you control multiple media sources from any website in a single place." Oh, I've got this Media Control and couldn't find how to disable it. I hate it when a button appears on a toolbar where there was none just before I press Play. I probably would find it at least somewhat useful if I could start playing media from any opened tab, but now it only shows controls for media I've already started playing. If anyone knows how to disable it - I'd appreciate a hint.
    • Now that he turned on Trump and both sides hate him does anyone want this stupid thing?
    • This is what I thought of earlier today because it seems a bit stupid to have an iPhone 17 running iOS 26 (or iOS 2026 / or even iOS 25/2025). Just make it simple so that the year of the hardware release and the software release are in sync. I personally think they should go with 25 or 2025 (not 26 or 2026), but syncing the hardware and software version numbers could be easier to keep track of. At first, it will maybe be jarring due to all of the changes across the ecosystem, but from that point on it will be easier to keep track of.
    • my dad is experiencing the same thing except it's with Excel. the font became thin compared to windows 10, all the settings the same. i've chalked it up to it being that its connected via DVI instead of HDMI. is your setup the same? i have no technical reasons to believe it's DVI, just a plain guess since the other screen he's connected to seems better to me although may just be my mind playing tricks.  also, why don't you change the text size in accessibility? maybe this will help?   
  • Recent Achievements

    • Week One Done
      abortretryfail earned a badge
      Week One Done
    • First Post
      Mr bot earned a badge
      First Post
    • First Post
      Bkl211 earned a badge
      First Post
    • One Year In
      Mido gaber earned a badge
      One Year In
    • One Year In
      Vladimir Migunov earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      492
    2. 2
      +FloatingFatMan
      256
    3. 3
      snowy owl
      248
    4. 4
      ATLien_0
      224
    5. 5
      +Edouard
      189
  • Tell a friend

    Love Neowin? Tell a friend!