I want to print the first 1000 characters in an UTF-8 encoded file. I know that the head tool can print the first n bytes of a file, but it may cut a character in the middle so that I get garbled output at the end.
I can write a awk program to do this, but may I know if there is any simpler way?
PS. I found it unreasonable that head and tail do not support character encoding (the LANG environment variable), while other tools such as cut, wc, sed and awk all support character encoding.