how to see characterset from wchar t we developed a toolkit running on the x window system the toolkit copes with any languages based on x r s i n facility as you know there are kinds of i n implementation from mit s x r release xsi and ximp our original implementation of the toolkit uses xsi our toolkit manages each character s size based on our own font management system in order to do that the wchar t typed character strings must be decomposed to character sets this means that if one wchar t type compound string with ascii and kanji mixed for example is given each element of the wchar t array must be checked its corresponding character set based on a bit layout and application environment s locale in this case if the locale is japanese each wchar t character will be classified either to iso jisx or so we need a function to do this the function must check how many characters from the top are the same character set and what the character set is we could not find any public x r function to do that and inevitably used xsi s internal functions to construct that function the following is the source code of that function decomposecharacterset i n h this may look like c code but it is really c id i n h v iima exp iima ifndef i n h define i n h include x xlib h extern int decomposecharacterset const wchar t wc str in int wc len in char buf out int buflen in out int scanned len out char charset out extern xmstring wchartoxmstring const wchar t wc str extern xmstringcharset charsetofwchar const wchar t wc endif i n h i n cc id i n cc v iima exp include stdlib h include x xlibint h include xm xm h include i n h extern c include x wchar h define xwcdecomposeglyphcharset xxx xwcdecomposeglyphcharset define xmbfscs xxx xmbfscs define xmbctidtocsid xxx xmbctidtocsid include xlocaleint h undef xwcdecomposeglyphcharset undef xmbfscs undef xmbctidtocsid extern int xwcdecomposeglyphcharset xlocale const wchar t int char int int int extern charset xmbfscs xlocale csid extern csid xmbctidtocsid xlocale csid int decomposecharacterset const wchar t wc str in int wc len in char buf out int buf len in out int scanned len out char charset out xlocale xlocale xfallbackconvert int ctid int status charset xcharset status xwcdecomposeglyphcharset xlocale wc str wc len buf buf len scanned len ctid if status success xcharset xmbfscs xlocale xmbctidtocsid xlocale ctid charset xcharset xcharset cs name null else charset null return status an included file above xlocaleint h is also xsi internal and we copied the file to the toolkit directory and compiled a serious issue occured when we tried to compile a toolkit application on our hp machine with its os version of hp ux when we tried to link an application based on our toolkit link errors occured saying that the following functions are missing xmbctidtocsid code xmbfscs code xwcdecomposeglyphcharset code xfallbackconvert code we had used mit release version of x r and its xsi implementation until hp up and ran applications successfully one of the reasons to use xsi was that because hp did not release hp s x r until the os and we had no way to know how hp s r would be implemented we had hoped xsi s popularity and used its internal functions the hp s linker complains that there are no xsi internal functions implemented we observe from hp s libx a they used some ximp implementation but we are not sure if they used mit s vanilla ximp version or their own version of ximp and therefore finding just counter part functions in mit s ximp for xsi does not seem to lead us a solution my question and goal is to know how we can construct a function like decomposecharacterset listed above is there any function to check character set of each element of wchar t type strings depending on locales if it is a public function that is perfect but even if it is not we want to use any internal functions in hp s x r as we did for mit s r in order to render a wchar t type string there must be some machinery to judge character sets and that is how the proper fonts are selected for the string we have no way to find out that without any hp s x r source files we want to know how we can use that for our goal any help or comments would be highly appreciated i also appreciate if anyone tell me about ximp treating around this area even if it is not hp s implementation thank you takeshi inoue inoue crd yokogawa co jp yokogawa electric corporation open systems laboratory
