georeference.org
Subscribe to this thread
Home - General / All posts - Getting Unicode Data in/out of Manifold
AR_Rick
95 post(s)
#20-May-08 19:35

Is there any way of getting Unicode data actually in and out of Manifold? Am I missing something blatant? According to some post I read somewhere, Manifold still keeps it's strings as Windows-1252 internally. Obviously I can encoding all of my strings with UTF-8 and Manifold won't touch them, but I'd really like to deal with the data directly. It's also becoming somewhat of a headache for people who I work with that aren't well-versed on codepages and character encodings.

I've been trying to shove Unicode data into Manifold all day and every single way I've tried has resulted in question marks (API, Paste, import MDB, import XLS). Within the coming year or so I expect to be dealing with a ton more international data and Unicode will pretty much be needed as I plan on dealing with the World as a whole within single components. I did try setting the Codepage (Language) to UTF-8 but it still wouldn't correctly display the extended character set.

By the way, when I put UTF-8 data into Manifold, it's storing the raw data as Windows 1252 which gets wrapped up inside of a Unicode (UTF-16) string when pushed to .NET. Conversion method:

    using System.Text;

    string UTF8izeWIN1252String(string input)

    {

        Encoding WIN1252 = Encoding.GetEncoding(1252);

        byte[] aIn = Encoding.Unicode.GetBytes(input);

        byte[] aOut = Encoding.Convert(Encoding.Unicode, WIN1252, aIn);

        return Encoding.UTF8.GetString(aOut);

    }

Fun fun.

0 msec Copyright (C) 2007-2008 Manifold.net. All rights reserved.