|
From: mow <mo...@ic...> - 2016-01-16 07:07:17
|
You can get more information about custom converters here: http://userguide.icu-project.org/conversion/data You should use the makeconv tool to convert the ucm file to cnv file. The ucnv_countAvailable function lists only the converters in the alias file. You should be able to load the converter (after using the makeconv tool) by either using the ICU_DATA or u_setDataDirectory() to where the dat file is located. -M On Tue, 12 Jan 2016 11:39:09 +0100, Jonatan Pålsson <jon...@pe...> wrote: > 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 thisy > 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 |