snipt

Ctrl+h for KB shortcuts

PHP

ISO to UTF conversion

iconv('ISO-8859-1', 'UTF-8',$str);
https://snipt.net/embed/81ece0f218e8520d4a9ba8cce68a6907/
/raw/81ece0f218e8520d4a9ba8cce68a6907/
81ece0f218e8520d4a9ba8cce68a6907
php
PHP
1
2019-07-21T07:24:12
True
False
False
/api/public/snipt/120490/
iso-to-utf-conversion
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="x">iconv(&#39;ISO-8859-1&#39;, &#39;UTF-8&#39;,$str);</span> </span></pre></div> </td></tr></table>
"character conversion", iso, php, utf-8

PHP

phpmailer utf-8 subject

// how to set utf-8 subject with PHPMailer 2
$phpmailer->Subject = "=?UTF-8?B?".base64_encode($subject)."?=";
https://snipt.net/embed/770eb56ab12f56a6c110ebc1b702d761/
/raw/770eb56ab12f56a6c110ebc1b702d761/
770eb56ab12f56a6c110ebc1b702d761
php
PHP
2
2019-07-13T08:19:28
True
False
False
/api/public/snipt/26523/
phpmailer-utf-8-subject
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="x">// how to set utf-8 subject with PHPMailer 2</span> </span><span id="L-2"><a name="L-2"></a><span class="x">$phpmailer-&gt;Subject = &quot;=?UTF-8?B?&quot;.base64_encode($subject).&quot;?=&quot;;</span> </span></pre></div> </td></tr></table>
phpmailer, utf-8

Bash

Create new databases with UTF8 explicitly specified

create database keystone default character set = 'utf8' \
   default collate = 'utf8_general_ci';
https://snipt.net/embed/cadffd1f5e84efd815fc16a2d1febbef/
/raw/cadffd1f5e84efd815fc16a2d1febbef/
cadffd1f5e84efd815fc16a2d1febbef
bash
Bash
2
2019-07-17T20:38:18
True
False
False
/api/public/snipt/15097/
create-new-databases-with-utf8-explicitly-specified
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>create database keystone default character <span class="nb">set</span> <span class="o">=</span> <span class="s1">&#39;utf8&#39;</span> <span class="se">\</span> </span><span id="L-2"><a name="L-2"></a> default <span class="nv">collate</span> <span class="o">=</span> <span class="s1">&#39;utf8_general_ci&#39;</span><span class="p">;</span> </span></pre></div> </td></tr></table>
mysql, utf-8

MySQL

que encodign tiene mysql

SHOW VARIABLES LIKE "character\_set\_database";
https://snipt.net/embed/ae4f5f5e670b388b1da17f808180c5dd/
/raw/ae4f5f5e670b388b1da17f808180c5dd/
ae4f5f5e670b388b1da17f808180c5dd
mysql
MySQL
1
2019-07-17T10:33:13
True
False
False
/api/public/snipt/13085/
que-encodign-tiene-mysql
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">SHOW</span> <span class="n">VARIABLES</span> <span class="k">LIKE</span> <span class="s2">&quot;character\_set\_database&quot;</span><span class="p">;</span> </span></pre></div> </td></tr></table>
encoding, mysql, unicode, utf-8