<?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>Saiweb &#187; c++</title>
	<atom:link href="http://www.saiweb.co.uk/tag/c/feed" rel="self" type="application/rss+xml" />
	<link>http://www.saiweb.co.uk</link>
	<description>Ramblings of a Sys admin</description>
	<lastBuildDate>Mon, 06 Feb 2012 14:57:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>mySQL forcing utf-8 compliance for all connections.</title>
		<link>http://www.saiweb.co.uk/mysql/mysql-forcing-utf-8-compliance-for-all-connections</link>
		<comments>http://www.saiweb.co.uk/mysql/mysql-forcing-utf-8-compliance-for-all-connections#comments</comments>
		<pubDate>Wed, 12 Nov 2008 10:05:45 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
				<category><![CDATA[mySQL]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[init_connect]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[utf-8]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/mysql/mysql-forcing-utf-8-compliance-for-all-connections</guid>
		<description><![CDATA[The problem that most people face when setting up a UTF-8 database in mySQL is that without calling &#8216;SET NAMES&#8217; in the mySQL client prior to issuing any queries (PHP, C++ etc &#8230;) that the client connection will actually in most cases default to  latin-1. However as of mySQL 5.x or higher you can issue [...]]]></description>
			<content:encoded><![CDATA[<p>The problem that most people face when setting up a UTF-8 database in mySQL is that without calling &#8216;SET NAMES&#8217; in the mySQL client prior to issuing any queries (PHP, C++ etc &#8230;) that the client connection will actually in most cases default to  latin-1.</p>
<p>However as of mySQL 5.x or higher you can issue a statement in the my.cnf file calling init_connect.</p>
<p>This will trigger a series of defined commands / queries every time a non super user connects (So if you are using root to connect to your mySQL database, stop reading now and slap yourself HARD).</p>
<p>i.e.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[mysqld]<br />
init_connect='SET collation_connection = utf8_general_ci'<br />
init_connect='SET NAMES utf8'<br />
default-character-set=utf8<br />
character-set-server=utf8<br />
collation-server=utf8_general_ci<br />
skip-character-set-client-handshake</div></td></tr></tbody></table></div>
<p><strong>UPDATE 04/09/09</strong></p>
<p>my mySQL version 5.0.45 x64 only picks up the last entry of init_connect</p>
<p>Use this example in this case:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[mysqld]<br />
init_connect='SET collation_connection = utf8_general_ci; SET NAMES utf8;'<br />
default-character-set=utf8<br />
character-set-server=utf8<br />
collation-server=utf8_general_ci</div></td></tr></tbody></table></div>
<p>Restart mySQL and check the mysqld.log has not returned any errors (Or your event viewer if you are using windows).</p>
<p>Every client connection will now default to utf-8 encoding and not latin-1, removing the need to add a SET NAMES call on every connection.</p>
<p>This will work for PHP, C++, ruby etc&#8230; as the client encoding is now handeled server side, rather that waiting on the client to issue a SET NAMES command.</p>
<p><strong>UPDATE 30/03/09</strong>: Added &#8220;skip-character-set-client-handshake&#8221; this ignores the clients request to set the connection charset, this info courtesy of &#8220;wardo&#8221; <a href="http://word.wardosworld.com/?p=164 ">http://word.wardosworld.com/?p=164 </a></p>
<p><strong>UPDATE 10/09/09</strong></p>
<p>Been having some issues with this working the workaround is to add this config as a single line:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">init_connect='SET collation_connection = utf8_general_ci; SET NAMES utf8;'</div></td></tr></tbody></table></div>
<p><span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/mysql/mysql-forcing-utf-8-compliance-for-all-connections" data-text="mySQL forcing utf-8 compliance for all connections." href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Fmysql%2Fmysql-forcing-utf-8-compliance-for-all-connections&#038;text=mySQL%20forcing%20utf-8%20compliance%20for%20all%20connections." >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/mysql/mysql-forcing-utf-8-compliance-for-all-connections/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Very basic C++ GDB tutorial</title>
		<link>http://www.saiweb.co.uk/linux/very-basic-c-gdb-tutorial</link>
		<comments>http://www.saiweb.co.uk/linux/very-basic-c-gdb-tutorial#comments</comments>
		<pubDate>Wed, 09 Apr 2008 20:13:36 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[gdb]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/?p=35</guid>
		<description><![CDATA[a very basic video tutorial covering how to compile with debug information, load your app into gdb, set breakpoints and step through it. No where near as much details as I wanted, but I never seem to get time to finish the full version, this will help in the interim. NOTE: you will need XviD [...]]]></description>
			<content:encoded><![CDATA[<p>a very basic video tutorial covering how to compile with debug information, load your app into gdb, set breakpoints and step through it.</p>
<p>No where near as much details as I wanted, but I never seem to get time to finish the full version, this will help in the interim.</p>
<p>NOTE: you will need XviD codec or use VLC.</p>
<p>If you re-distribute the video please give a link back (don&#8217;t force me to start water marking).</p>
<p><div id="saiweb_3f2204e9a02cd46daeb5455ec3025230" style="width:600px; height:450px;"></div><script language="Javascript" type="text/javascript">
	WPFP(document).ready(function() {
		//load player
		$f("saiweb_3f2204e9a02cd46daeb5455ec3025230", "/wp-content/plugins/wordpress-flowplayer/flowplayer/gpl/flowplayer-3.1.5.swf", {
				plugins: {
  					 controls: {    					
      					
      					
      					
      					sliderGradient: 'none',
      					progressGradient: 'medium',
      					
      					
      					backgroundColor: '#141648',
      					
      					
      					backgroundGradient: 'none',
      					bufferGradient: 'none',
   						opacity:1.0
   						}
				},
			clip: {
					url:'gdb.flv',
					autoPlay: false,
       				autoBuffering: false
				},
				canvas: {
					backgroundColor:''
				}})
			});</script>
				<span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/linux/very-basic-c-gdb-tutorial" data-text="Very basic C++ GDB tutorial" href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Flinux%2Fvery-basic-c-gdb-tutorial&#038;text=Very%20basic%20C%2B%2B%20GDB%20tutorial" >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/linux/very-basic-c-gdb-tutorial/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://cdn.saiweb.co.uk/wp-content/uploads/2008/04/gdb.avi" length="9223680" type="video/x-msvideo" />
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching 6/22 queries in 0.066 seconds using apc
Object Caching 682/722 objects using apc
Content Delivery Network via Rackspace Cloud Files: cdn.saiweb.co.uk

Served from: www.saiweb.co.uk @ 2012-02-07 15:59:27 -->
