Tuesday, February 07, 2006

About Subversion and special characters

I had a nasty problem with subversion right from the start and finally have a solution for it. As always, the solution is quite obvious when you finally have it.

The problem with subversion is that it treats files with UTF16 characters as binary. Because I had a single such character in one of the source files (the square root character '√'), subversion treated the file as binary which as a consequence doesn't let you diff the file anymore.

I first thought I could use C# partial class feature which lets you define different parts of the same class in different files, but the version of C# (or of the .NET framework) I'm using doesn't seem to support it yet.

The solution is much simpler though. There's a special escape sequence to embed unicode characters into a string: '\xhhhh'. So '√x' becomes '\x221ax'.

0 Comments:

Post a Comment

<< Home