1

See, it keep to be us-ascii. iconv success with no warning, but file -bi show it's not converted:

$ file -bi tmpaaa 
    text/html; charset=us-ascii
$ iconv -f us-ascii -t utf-8 tmpaaa -o tmpb
$ cp tmpb tmpaaa
$ file -bi tmpaaa 
    text/html; charset=us-ascii
$ 

And my another scripts keep complain it's not utf-8. Who know what's happened? The machine is Ubuntu/Linux, LANG=en_US-UTF-8

Andrew_1510
  • 12,258
  • 9
  • 51
  • 52

1 Answers1

4

Maybe your file doesn't contain any special character (only English letters, numbers and punctuation)?

Andriy M
  • 76,112
  • 17
  • 94
  • 154
Maxim
  • 1,209
  • 15
  • 28
  • +1 It should be pointed out that a file containing only ASCII characters is simply already in UTF-8 format, too. If it's correctly encoded in US-ASCII then there is no "maybe". – tripleee Nov 25 '12 at 16:24
  • Correct, but the other script might expect a BOM, see [this answer](http://stackoverflow.com/a/4365180/33499) – wimh Nov 25 '12 at 19:35