|
From: Jonatan P. <jon...@pe...> - 2016-01-12 11:03:47
|
Hello,
I'm trying to load a custom converter, and use this converter to convert
into Unicode, but I am having issues. I don't want to install this
converter globally in my system, but I would like to load it only for my
program.
I have written a ucm file for a custom converter (the European Broadcasting
Union Latin code). I then created a cnv file from this ucm using gencmn.
I've also created a dat file using pkgdata.
After I have created these files, I am a bit unclear on what I should do. I
have tried the following:
Create a C program which lists the number of available converters
using ucnv_countAvailable, and run this program with the ICU_DATA
environment variable exported to the directory containing my cnv file. This
yields 231 converters, which I can only assume are my system-global
converters. So it seems my converter is not picked up here.
u_setDataDirectory() yields the same results as exporting ICU_DATA. I also
tried specifying the cnv file itself using u_setDataDirectory(), as well as
the dat file. Same result.
I also tried using ucnv_openPackage() to open the dat file, specifically I
tried:
> ucnv_openPackage("./ebu-latin.dat", "ebu-latin", &error);
I also tried absolute paths. From the documentation it seems like I should
not use a path, but a package name, I therefore tried "ebu-latin" as well.
Each of these combinations yield a U_FILE_ACCESS_ERROR.
I am trying this on a Debian system, with the stock version of ICU.. Do I
need to compile ICU with some special options in order to allow loading of
custom converters/resources?
I think I am unclear of the entire process of how a custom converter can be
loaded, could someone help me out by specifying the steps of loading a
custom converter?
Thanks a lot.
-- Jonatan
|