<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.mysql.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.mysql-set-charset.php',
    1 => 'mysql_set_charset',
    2 => 'Sets the client character set',
  ),
  'up' => 
  array (
    0 => 'ref.mysql.php',
    1 => 'MySQL Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.mysql-select-db.php',
    1 => 'mysql_select_db',
  ),
  'next' => 
  array (
    0 => 'function.mysql-stat.php',
    1 => 'mysql_stat',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mysql/functions/mysql-set-charset.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mysql-set-charset" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mysql_set_charset</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.3)</p><p class="refpurpose"><span class="refname">mysql_set_charset</span> &mdash; <span class="dc-title">Sets the client character set</span></p>

 </div>

 <div id="function.mysql-set-charset-refsynopsisdiv">
  <div class="warning"><strong class="warning">Avviso</strong>
   <p class="para">Questa enstensione  deprecata da PHP 5.5.0, e sarà rimossa in futuro.
Al suo posto, usare l&#039;estensione <a href="book.mysqli.php" class="link">MySQLi</a> o <a href="ref.pdo-mysql.php" class="link">PDO_MySQL</a>.
Vedere anche la guida <a href="mysqlinfo.api.choosing.php" class="link">MySQL: scelta dell&#039;API</a> e
le <a href="faq.databases.php#faq.databases.mysql.deprecated" class="link">FAQ relative</a> per ulteriori informazioni. 
Le alternative a questa funzione includono:</p>
   <ul class="simplelist">
    <li><span class="function"><a href="mysqli.set-charset.php" class="function">mysqli_set_charset()</a></span></li>
    <li>PDO: Add <code class="literal">charset</code> to the connection string, such as <code class="literal">charset=utf8</code></li>
   </ul>
  </div>
 </div>

 <div class="refsect1 description" id="refsect1-function.mysql-set-charset-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mysql_set_charset</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$charset</code></span>, <span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$link_identifier</code><span class="initializer"> = NULL</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   Sets the default character set for the current connection.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mysql-set-charset-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <dl>
   
    <dt><code class="parameter">charset</code></dt>
    <dd>
     <span class="simpara">
      A valid character set name.
     </span>
    </dd>
   
   <dt><code class="parameter">
link_identifier</code></dt><dd><p class="para">La connessione MySQL. Se 
l&#039;identificativo di connessione non è specificato, l&#039;ultima connessione aperta da
<span class="function"><a href="function.mysql-connect.php" class="function">mysql_connect()</a></span> viene assunta. Se questa connessione non è trovata, si
cercherà di crearne una come se <span class="function"><a href="function.mysql-connect.php" class="function">mysql_connect()</a></span> fosse stata chiamata
senza argomenti. Se una connessione non è trovata oppure non viene stabilita, un
avviso di livello <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> viene generato.</p></dd>

  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mysql-set-charset-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="simpara">
   Restituisce <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> in caso di successo, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> in caso di fallimento.
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.mysql-set-charset-notes">
  <h3 class="title">Note</h3>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <span class="simpara">
    This function requires MySQL 5.0.7 or later.
   </span>
  </p></blockquote>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <span class="simpara">
    This is the preferred way to change the charset. Using
    <span class="function"><a href="function.mysql-query.php" class="function">mysql_query()</a></span> to set it (such as <code class="literal">SET NAMES utf8</code>)
    is not recommended. See the <a href="mysqlinfo.concepts.charset.php" class="link">MySQL character set concepts</a>
    section for more information.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.mysql-set-charset-seealso">
  <h3 class="title">Vedere anche:</h3>
  <ul class="simplelist">
   <li><a href="mysqlinfo.concepts.charset.php" class="link">Setting character sets in MySQL</a></li>
   <li><a href="http://dev.mysql.com/doc/mysql/en/charset-charsets.html" class="link external">&raquo;&nbsp;List of character sets that MySQL supports</a></li>
   <li><span class="function"><a href="function.mysql-client-encoding.php" class="function" rel="rdfs-seeAlso">mysql_client_encoding()</a> - Returns the name of the character set</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>