{"id":2542,"date":"2012-12-28T12:28:04","date_gmt":"2012-12-28T11:28:04","guid":{"rendered":"http:\/\/blog.unelink.es\/?p=2542"},"modified":"2016-03-21T15:23:08","modified_gmt":"2016-03-21T14:23:08","slug":"consultar-la-codificacion-de-un-fichero-en-linux","status":"publish","type":"post","link":"https:\/\/hosting.airetech.es\/blog\/wiki\/consultar-la-codificacion-de-un-fichero-en-linux\/","title":{"rendered":"Consultar la codificaci\u00f3n de un fichero en Linux"},"content":{"rendered":"<p>Si queremos saber la codificaci\u00f3n que tiene un fichero determinado (UTF-8, ISO-8859, etc), en Linux podemos hacerlo de forma muy f\u00e1cil usando el comando \"file\".<\/p>\n<p>Por ejemplo, si queremos conocer la codificaci\u00f3n de un fichero llamado \"ejemplo.php\", escribimos en la consola el siguiente comando:<\/p>\n<pre>file -bi ejemplo.php<\/pre>\n<p>Obtendremos una respuesta similar a:<\/p>\n<pre>text\/plain; charset=utf-8<\/pre>\n<p>El valor de la propiedad \"charset\" es la que nos indica la codificaci\u00f3n. En este ejemplo, el fichero est\u00e1 codificado en UTF-8. Si quer\u00e9is conocer m\u00e1s posibilidades del comando \"file\", siempre puedes consultar el manual o la ayuda desde la consola, usando alguno de estos dos comandos:<\/p>\n<pre>man file<\/pre>\n<pre>file --help<\/pre>\n","protected":false},"excerpt":{"rendered":"Si queremos saber la codificaci\u00f3n que tiene un fichero determinado (UTF-8, ISO-8859, etc), en Linux podemos hacerlo de forma muy f\u00e1cil usando el comando \"file\". Por ejemplo, si queremos conocer la codificaci\u00f3n de un fichero llamado \"ejemplo.php\", escribimos en la consola el siguiente comando: file -bi ejemplo.php Obtendremos una respuesta similar a: text\/plain; charset=utf-8 El valor de la propiedad \"charset\"&nbsp;<a href=\"https:\/\/hosting.airetech.es\/blog\/wiki\/consultar-la-codificacion-de-un-fichero-en-linux\/\" class=\"read-more\">Seguir leyendo<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,6],"tags":[216],"class_list":["post-2542","post","type-post","status-publish","format-standard","hentry","category-linux","category-wiki","tag-linux","cat-10-id","cat-6-id"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/2542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/comments?post=2542"}],"version-history":[{"count":6,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/2542\/revisions"}],"predecessor-version":[{"id":4603,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/2542\/revisions\/4603"}],"wp:attachment":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/media?parent=2542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/categories?post=2542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/tags?post=2542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}