<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Philben - Ms Access &#187; UTF-8</title>
	<atom:link href="https://blog.developpez.com/philben/ptag/utf-8/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.developpez.com/philben</link>
	<description></description>
	<lastBuildDate>Thu, 26 Sep 2013 19:43:53 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Encoder un texte en UTF-8</title>
		<link>https://blog.developpez.com/philben/p10825/vba-access/encoder_un_texte_en_utf8</link>
		<comments>https://blog.developpez.com/philben/p10825/vba-access/encoder_un_texte_en_utf8#comments</comments>
		<pubDate>Mon, 12 Mar 2012 20:36:16 +0000</pubDate>
		<dc:creator><![CDATA[philben]]></dc:creator>
				<category><![CDATA[VBA - Ms Access]]></category>
		<category><![CDATA[Chaîne de caractères]]></category>
		<category><![CDATA[Code VBA]]></category>
		<category><![CDATA[UTF-8]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Si vous êtes utilisateur de web services ou si vous avez besoin d&#8217;encoder des chaînes de caractères en UTF-8, Cette fonction en VBA va vous aider&#8230; Public Function URIEncodeUTF8(ByVal sURI As String) As String 'Author : Philben - v1.0 - &#8230; <a href="https://blog.developpez.com/philben/p10825/vba-access/encoder_un_texte_en_utf8">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Si vous êtes utilisateur de web services ou si vous avez besoin d&rsquo;encoder des chaînes de caractères en UTF-8,<br />
Cette fonction en <strong>VBA</strong> va vous aider&#8230;<br />
<span id="more-3"></span></p>
<div class="codecolorer-container vb blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #E56717; font-weight: bold;">Public</span> <span style="color: #E56717; font-weight: bold;">Function</span> URIEncodeUTF8(<span style="color: #151B8D; font-weight: bold;">ByVal</span> sURI <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">String</span>) <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">String</span><br />
<span style="color: #008000;">'Author : Philben - v1.0 - free to use<br />
</span> &nbsp; <span style="color: #151B8D; font-weight: bold;">Dim</span> sUTF8 <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">String</span>, lCode <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Long</span>, i <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Long</span>, abyURI() <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Byte</span><br />
<br />
&nbsp; &nbsp;abyURI = StrConv(sURI, vbUnicode)<br />
<br />
&nbsp; &nbsp;<span style="color: #8D38C9; font-weight: bold;">For</span> i = 0 <span style="color: #8D38C9; font-weight: bold;">To</span> <span style="color: #151B8D; font-weight: bold;">UBound</span>(abyURI) <span style="color: #8D38C9; font-weight: bold;">Step</span> 4<br />
&nbsp; &nbsp; &nbsp; lCode = abyURI(i) + abyURI(i + 1) * &amp;H10&amp; + abyURI(i + 2) * &amp;H100&amp; + abyURI(i + 3) * &amp;H1000&amp;<br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Select</span> <span style="color: #8D38C9; font-weight: bold;">Case</span> lCode<br />
&nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Case</span> 48 <span style="color: #8D38C9; font-weight: bold;">To</span> 57, 65 <span style="color: #8D38C9; font-weight: bold;">To</span> 90, 97 <span style="color: #8D38C9; font-weight: bold;">To</span> 122 &nbsp; <span style="color: #008000;">'1-9, A-Z, a-z =&gt; pas d'encodage<br />
</span> &nbsp; &nbsp; &nbsp; &nbsp; sUTF8 = sUTF8 &amp; Chr(lCode)<br />
&nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Case</span> <span style="color: #8D38C9; font-weight: bold;">Is</span> &lt; &amp;H80&amp; &nbsp; <span style="color: #008000;">'de 0 à 127<br />
</span> &nbsp; &nbsp; &nbsp; &nbsp; sUTF8 = sUTF8 &amp; Format(Hex(lCode), <span style="color: #800000;">&quot;%@@&quot;</span>)<br />
&nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Case</span> <span style="color: #8D38C9; font-weight: bold;">Is</span> &lt; &amp;H800&amp; &nbsp; <span style="color: #008000;">'de 128 à 2047<br />
</span> &nbsp; &nbsp; &nbsp; &nbsp; sUTF8 = sUTF8 &amp; Format(Hex(&amp;HC0&amp; <span style="color: #8D38C9; font-weight: bold;">Or</span> (lCode \ &amp;H40&amp;)) &amp; _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hex(&amp;H80&amp; <span style="color: #8D38C9; font-weight: bold;">Or</span> (lCode <span style="color: #8D38C9; font-weight: bold;">And</span> &amp;H3F&amp;)), <span style="color: #800000;">&quot;%@@%@@&quot;</span>)<br />
&nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Case</span> <span style="color: #8D38C9; font-weight: bold;">Is</span> &lt; &amp;H10000 &nbsp; <span style="color: #008000;">'de 2048 à 65535<br />
</span> &nbsp; &nbsp; &nbsp; &nbsp; sUTF8 = sUTF8 &amp; Format(Hex(&amp;HE0&amp; <span style="color: #8D38C9; font-weight: bold;">Or</span> (lCode \ &amp;H1000&amp;)) &amp; _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hex(&amp;H80&amp; <span style="color: #8D38C9; font-weight: bold;">Or</span> ((lCode \ &amp;H40&amp;) <span style="color: #8D38C9; font-weight: bold;">And</span> &amp;H3F&amp;)) &amp; _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hex(&amp;H80&amp; <span style="color: #8D38C9; font-weight: bold;">Or</span> (lCode <span style="color: #8D38C9; font-weight: bold;">And</span> &amp;H3F&amp;)), <span style="color: #800000;">&quot;%@@%@@%@@&quot;</span>)<br />
&nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">Case</span> <span style="color: #8D38C9; font-weight: bold;">Else</span> &nbsp; <span style="color: #008000;">'&gt;= 65536<br />
</span> &nbsp; &nbsp; &nbsp; &nbsp; sUTF8 = sUTF8 &amp; Format(Hex(&amp;HF0&amp; <span style="color: #8D38C9; font-weight: bold;">Or</span> (lCode \ &amp;H40000)) &amp; _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hex(&amp;H80&amp; <span style="color: #8D38C9; font-weight: bold;">Or</span> ((lCode \ &amp;H1000&amp;) <span style="color: #8D38C9; font-weight: bold;">And</span> &amp;H3F&amp;)) &amp; _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hex(&amp;H80&amp; <span style="color: #8D38C9; font-weight: bold;">Or</span> ((lCode \ &amp;H40&amp;) <span style="color: #8D38C9; font-weight: bold;">And</span> &amp;H3F&amp;)) &amp; _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hex(&amp;H80&amp; <span style="color: #8D38C9; font-weight: bold;">Or</span> (lCode <span style="color: #8D38C9; font-weight: bold;">And</span> &amp;H3F&amp;)), <span style="color: #800000;">&quot;%@@%@@%@@%@@&quot;</span>)<br />
&nbsp; &nbsp; &nbsp; <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">Select</span><br />
&nbsp; &nbsp;<span style="color: #8D38C9; font-weight: bold;">Next</span> i<br />
&nbsp; &nbsp;URIEncodeUTF8 = sUTF8<br />
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Function</span></div></div>
<p>&nbsp;<br />
<strong>Exemple d&rsquo;utilisation</strong></p>
<div class="codecolorer-container vb blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">? URIEncodeUTF8(<span style="color: #800000;">&quot;un hélicoptère&quot;</span>) 'Chaîne obtenue : un%20h%C3%A9licopt%C3%A8re</div></div>
<p>@+</p>
<p>Philippe</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
