Javascript’s escape() in C# – a C# equivalent to the escape()-function

csharp_vs_javascriptThe .NET framework provides a large number of ways to encode HTML code and URLs. There exist, for example, Uri.EscapeDataString(), Uri.EscapeUriString(), System.Web.HttpUtility.UrlEncode(), System.Web.HttpUtility.UrlPathEncode(), System.Web.HttpUtility.HtmlEncode() or System.Web.HttpUtility.HtmlAttributeEncode().
However, if you are looking for equivalent functionality to Javascript’s escape(), so you will be disappointed by all of these aforementioned functions. None of these inherently with the .NET framework delivered functions is equivalent to the Javascript escape() function.  For better understanding, I made the following example:
The test text is in german, because the ‘ä’ is a nice character to show the problems. Translated to english it means: “Raffi’s annoying C# testcode”.

// Original source text
// Raffi’s ärgerlicher C# Teststring/Testcode.

// Javascript original (produced by escape())
// Raffi%27s%20%E4rgerlicher%20C%23%20Teststring/Testcode.

// Uri.EscapeDataString():
// Raffi’s%20%C3%A4rgerlicher%20C%23%20Teststring%2FTestcode.

// Uri.EscapeUriString():
// Raffi’s%20%C3%A4rgerlicher%20C#%20Teststring/Testcode.

// System.Web.HttpUtility.UrlEncode():
// Raffi%27s+%c3%a4rgerlicher+C%23+Teststring%2fTestcode.

// System.Web.HttpUtility.UrlPathEncode():
// Raffi’s%20%c3%a4rgerlicher%20C#%20Teststring/Testcode.

// System.Web.HttpUtility.HtmlEncode():
// Raffi's ärgerlicher C# Teststring/Testcode.

// System.Web.HttpUtility.HtmlAttributeEncode():
// Raffi's ärgerlicher C# Teststring/Testcode.

But I would not blog about it if I did not have a […]

QRCoder – an Open Source QR code generator implementation in C#

QRCoder demoIn modern times QR codes should be known by pretty much everyone. Since smartphones are becoming increasingly popular, QR codes can also be found at more and more places in our everyday lives. As a fairly serious geek this should be reason enough to engage a bit more in detail with the technology behind it. And what way seems to be more suitable than implementing a QR code generator by yourself?
Because C# is my favourite programming language, the choice fell accordingly to this language. Sadly information on the QR code are not so easy to get. The easiest way of course would be the official way – simply buy the ISO/IEC document. That would be the ISO/IEC 18004. But there’s also a crux on that. The ISO 18004 […]

Workaround: Canon EOS 300D Windows 7 drivers

Canon EOS 300DRecently I put my hands on a Canon EOS 300D and should copy a few photos from the camera to the PC. Easier said than done. The camera has a few years under his belt and Windows 7 was seemingly not able to find suitable drivers. Also the Windows driver search did not help.
Now comes the part where I want to apologize for the misleading headline. In fact I have no Windows 7 driver for you. However, I have a solution on how to get the Canon EOS 300D running under Windows 7 without additional drivers. Therefore just a setting in the camera menu must be changed.
Connect Canon EOS 300D with Windows 7 – how it works
Step 1:
Turn on the camera and click on the “Menu” button on the left edge of the display.

How to embed Youtube videos in PowerPoint 2007

I already wrote an article about how to embed Youtube videos in PowerPoint 2010 presentations. Today I want to show you how this works in PowerPoint 2007. However, for this you need first the developer tools. If you do not have this enabled, you can catch up quickly in this way.
I would like to mention quickly that the screenshots in this manual are from PowerPoint 2010, since I have no PowerPoint 2007 here. The method that I show here, but definitely works well with PowerPoint 2007. So please do not be put off by the screenshots.
Step 1:
Click on the Developer-Tab in the ribbon menu and then on the button with the hammer and wrench. A window opens with a fairly long list of controls, which can be embedded into your PowerPoint presentation. Select from this list the “Shockwave Flash Object” and confirm by clicking the “OK” button.

How to show developer tab in Office 2007/2010

If the Microsoft Office applications come to their limits, you can help out in many cases with the developer tools. These allow you to write macros, which are small programs in VBA (Visual Basic for Applications) and thus still give your Office projects that certain “liveliness”. However, the tab with the developer tools (Developer tab) isn’t displayed by default. How to enable it in Office 2007 and Office 2010, I want to show you (using PowerPoint) today.
How to show Developer Tools in PowerPoint 2007
Click on the “Menu” button and in the menu that opens, click the “PowerPoint Options” button. Now in the Options window, below the “Commonly used” section, you can find a box where you can activate the developer tools in the ribbon bar.
Activate Developer Tab in Office 2007 (1)  Activate Developer [...]
</p>
	</div><!-- .entry-summary -->
	
	<footer class=