Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just want to say that I love the way this page looks and think that I'm going to ~steal~ take inspiration from it.


Thanks! I found that you need to add some kind of magic chars [0] at the beginning of the txt file in order to display utf-8 chars (prevent this éà  :P), here's how to do it:

    echo -e "\xef\xbb\xbf\n" > myfilename.txt
[0]: https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8


I'm guessing you wouldn't need that if you set this header:

  Content-Type: text/plain; charset=utf-8


That's another level of work :P

I created the whole https://misc.l3m.in/txt/ trying to prove a point with a friend (the point was something like "you can start a blog right away if you have a domain name and a ssh access to a server, let me show you") :D


You're using apache which I'm guessing you installed. If so I think adding `AddDefaultCharset utf-8` to the config should be enough, and probably easier than adding a BOM to each of your files.


Oh, the good old PHP days, when the BOM was considered a source of bugs :)


Ah, good to know! Thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: