How to solve representation/encoding errors in C# Winforms applications

I know the title of this post hurts, but I wasn’t able to describe the problem with fewer words. But let us get to the point. As part of the development of my cloud downloader I encountered (among much others) the following problem. Korean characters were displayed as blank boxes, even though they were shown in the source code editor correctly. Those of you, who wonder now,  from where you can get the Korean characters on your keyboard, should just stop by Google Translate. (The screenshot below illustrates the problem once again. Please click to enlarge the image.)
Koreanische Zeichen falsche Darstellung
On the Internet I found only very few solutions. And almost all were, in my opinion, rather suboptimal. In most cases the following solution was proposed:
It is recommended that you call the SetCompatibleTextRenderingDefault() method with the parameter true. In […]

How to make simple syntax hightlighter in PHP

PHP SyntaxhighlighterIn the following article I will show you how you can write your own syntax highlighter with a few lines of PHP. By use of the following PHP snippet you can easily display PHP code on your homepage.
The whole thing is much more easily than you think. Most of the work is done by an internal PHP function named highlight_file. This function reads a file and formats the source code in color. We then merely have to count the lines of the file and output the line numbers, as well as preformat the font.
Since the snippet is not that long, I think the comments in the snippet itself are sufficient. If you still have any questions, just write a comment.

<?php
function highlight_sourcecode($file)
{
//Count the lines of the input file
$amount_of_lines = count(file($file));

//Create a list with all line numbers
$list_linenumbers = range(1, $amount_of_lines);

//Format […]

How to add DLL to Visual Studio projects

Some days ago I received an email, in which I was asked, how to embed/include .dll-files to into Visual Studio projects. So here comes the answer to the question: How to add dlls to an ongoing Visual Studio project?
The solution to the problem is closer than some of you might think. First you right-click on the “references”-label in the Solution Explorer and click in the context menu on “Add reference” . (Fig. 1)
Now click on the “Browse” button, select the desired (. NET compatible) DLL and confirm your selection by clicking on the “Ok” button. (Fig. 2)
In the last step you can add the appropriate using directives in your source code for an easier access to the methods of the obtaining DLL. (Fig. 3)
Visual Studio - Verweise  Dlls auswählen