Web lists-archives.com

Re: UTF-8 character encoding




Am 20.06.2018 um 20:09 schrieb Lee:
> I'm looking at
>   https://cygwin.com/packaging-hint-files.html#pvr.hint
> and it starts off with
>   Use UTF-8 character encoding.
> 
> How do I do that and how do I check that I actually did use UTF-8
> character encoding _without_ using file?
> 
> for whatever it's worth:
> $ file unicode.html
> unicode.html: HTML document, UTF-8 Unicode text
> 
> $ file test.c
> test.c: C source, ASCII text
> 
> I used vi to create both files & I'd like to understand why file says
> one is ascii & the other is utf-8
> 
> Thanks,
> Lee

ASCII is a subset of UTF-8, so that's fine.

The file command will report ASCII as long as your text does not contain
any non-ASCII characters. If you add some (for example ÄÖÜ), it should
report UTF-8.

Regards,
Stefan


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple