Converting ISO-8859-1 data to UTF-8 (and back again)

Filed under: Windows — jac @ February 22, 2005 - 7:32 pm

Recently I had to convert ISO-8859-1 data to UTF-8. The quick and easy way to do this is to use iconv from the command line. Unfortunately this had to be done from within a Visual C++/MFC application on Windows (so Cygwin wasn’t really an option). Fortunately, I found libiconv-win32. I installed the source and built the library (part of the process involves installing gettext for Win32 - just follow the instructions).

Since making libiconv-win32 part of the app’s project and adding the appropriate function calls, this app can now convert ISO-8859-1 data to UTF-8 (and back again).



An Interview Question

Filed under: C++ — jac @ February 10, 2005 - 2:54 pm

Here’s some code stolen from The Daily WTF:

ushort GetAsciiValue (uchar ch)
{
    ushort i;
    for (i=0; i<=255; i++)
    {
        if(ch == i)
            return i;
    }
    return 0;
}

It might be interesting to show this code to a candidate for a C/C++ position. Ask him/her if there is anything wrong with this code, and if so, how he/she would implement GetAsciiValue.



Matrix Template Library

Filed under: C++, Math / Numerical Analysis — jac @ February 6, 2005 - 2:46 pm

While rewriting some data analysis software I developed many years ago (the original was written in K & R C, the new version will be written in C++), I stumbled upon The Matrix Template Library (MTL). MTL is a library that provides comprehensive linear algebra functionality for a wide variety of matrix formats.

I was researching ways to implement my own matrix template library when I found MTL. After checking it out, I’m thinking of just using MTL since it’s more than adequate for my present needs and the support for a wide variety of matrix formats might be useful for future projects.

The only drawback I see is MTL hasn’t been updated in about three years.



Two Free Computer Algebra Systems

Filed under: Math / Numerical Analysis — jac @ February 2, 2005 - 7:58 am

A few months ago I was looking for a free computer algebra system (CAS). For some reason (probably I wasn’t really looking hard enough), I didn’t find anything that the bill.

Yesterday, while updating Cygwin on my Windows box at work, I saw a link to something called Mathomatic.

I turns out that Mathomatic is a nifty console based computer algebra system (follow the link and you can try Mathomatic via telnet).

The Mathomatic page includes a link to Maxima, a descendant of DOE Macsyma. Maxima is a more complete CAS then Mathomatic, but is a little more complicated to install.




  



February 2005
M T W T F S S
« Jan   Apr »
 123456
78910111213
14151617181920
21222324252627
28  

Statistics

There are currently 31 posts and 16 comments, contained within 12 categories.


Miscellaneous
- Source Files

Add to Technorati Favorites



Storage B
-OpenDDS Version 1.2 Released
-FreeVMS
-OpenDDS Version 1.1 Released
-C++ functions to convert between decimal degrees and degrees, minutes, and seconds
-WordPress 2.5
-Multics
-C++ Functions to Evaluate Chebyshev Polynomials
-OpenDDS
-X Windows Programming in C++: Part III
-X Windows Programming in C++: Part II

Valid XHTML 1.0!

Valid CSS!