gsusmonzon

Thursday, December 4, 2014

Quicktip : Remove invalid utf8 charactes in a file

Whenever I need to check if a file contains invalid utf8 chars:

isutf8 file.txt

(in ubuntu, you need to install the `moreutils` package)

Then, to rremove invalid chars, use iconv:

iconv -f utf-8 -t utf-8 -c nonutf-8.txt > utf8.txt

-c stands for remove `invalid chars`
-f 'from' utf8
-t 'to' utf8 
Posted by gsusmonzon at 10:17 AM No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

About Me

My photo
gsusmonzon
View my complete profile

Search This Blog

Blog Archive

  • ►  2021 (1)
    • ►  October (1)
  • ►  2019 (1)
    • ►  October (1)
  • ►  2017 (2)
    • ►  August (1)
    • ►  June (1)
  • ►  2016 (2)
    • ►  September (2)
  • ►  2015 (2)
    • ►  July (1)
    • ►  June (1)
  • ▼  2014 (7)
    • ▼  December (1)
      • Quicktip : Remove invalid utf8 charactes in a file
    • ►  October (1)
    • ►  May (2)
    • ►  March (2)
    • ►  February (1)
  • ►  2013 (9)
    • ►  November (1)
    • ►  September (1)
    • ►  August (2)
    • ►  July (2)
    • ►  May (2)
    • ►  March (1)
  • ►  2012 (11)
    • ►  November (2)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (1)
    • ►  May (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (2)
  • ►  2011 (12)
    • ►  December (1)
    • ►  October (1)
    • ►  September (4)
    • ►  May (2)
    • ►  April (2)
    • ►  March (2)
Simple theme. Theme images by duncan1890. Powered by Blogger.