TinyApps.Org
Small is beautiful


 HOME

  0. Internet
  1. Text
  2. Graphics
  3. System
  4. File
  5. Misc
  6. Palm
  7. OS X

 BLOG

 DOCS

 FAQ

 RSS (?)





Convert numbers and spaces from full-width (double-byte) to half-width (single-byte) #

Within filenames (using Bash, Perl, and Unicode-Japanese-0.47):
  1. $sudo perl -MCPAN -e shell
  2. cpan> install Unicode::Japanese
  3. Save the following script (adapted largely from togdon's example) as full2half.sh and make it executable (chmod u+x):
    #!/bin/bash
    for file in *;do
    newfile=$(echo $file | perl -MUnicode::Japanese -e'print Unicode::Japanese->new(<>)->z2h->get;')
    test "$file" != "$newfile" && mv "$file" "$newfile"
    done
  4. cd to desired directory and run script:
    $ /path/to/full2half.sh
    Convert full-width numbers and spaces to half-width
Within file contents (using OpenOffice.org):
  1. Tools > Options... (in OS X it's OpenOffice.org > Preferences...)
  2. Language Settings > Languages > check "Enabled for Asian languages" > OK
  3. Highlight text > Format > Change Case > Full-width or Half-width

/nix | Jan 02, 2010



Categories
/blosxom
/eink
/mac
/misc
/nix
/palm
/windows

Blosxom Archive
2012: 2 1
2011: 12 11 10 9 8 7 6 5 4 3 2 1
2010: 12 11 10 9 8 7 6 5 4 3 2 1
2009: 12 11 10 9 8 7 6 5 4 3 2 1
2008: 12 11 10 9 8 7 6 5 4 3 2 1
2007: 12 11 10 9 8 7 6 5 4 3 2 1
2006: 12 11 10 9 8 7 6 5 4 3 2 1
2005: 12 11 10

Blogger Archive
2005: 10 9 8 7 6 5 4 3 2 1
2004: 12 11 10 9 8 7 6 5 4 3 2 1
2003: 12 11 10 9 8 7 6

Ezine Archive
2004: 4 3 2 1
2003: 12 9 8 7 6 5 4 2 1
2002: 12 10 9 8 7 6 5 3 2 1
2001: 12 11 10