SEARCH YOUR SOLUTION HERE  

library with codecvt for state depending encoding



I'm searching for a c++ library with support for state dependent
cadecvt facets. My current environment is FC8 with g++ 4.1.2
and the corresponding libstdc++ lib. This offers all kind
of codecvt facets supported by the underlying "locale"
system.

However none of the code conversion tables seem to support
state dependent I/O (e.g. ISO-2022-JP) as far as I can tell.

There is an iconv based gnu specific codecvt specialization which
seems to be more than buggy.

Is there some library around which supports something like this:


std::locale jp_loc("ja_JP.ISO-2022-JP");

typedef std::codecvt codecvt_type;

codecvt_type * cv = std::use_facet( &jp_loc);



Thank you very much indeed

O.


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Posted On: Wednesday 7th of November 2012 11:36:36 AM Total Views:  541
View Complete with Replies




Related Messages:

Processing Images: Need good library for various image formats   (299 Views)
Hi! I'd like to manipulate Images of various types (PNG, JPEG, GIF, BMP, maybe more) with a C++ program. Now I've found the Cimg library, but before diving deeper into that lib, I'd like to have some suggestions on other librarys for image processing. Those libs, don't need to be elaborate or something, resizing and cutting the image into smaler parts would be sufficient. However, I'd like that lib to be able to handle a variety of image-types. Any suggestions regards --polemon -- -EOF-
N2369 library defect: Missing [c.math] functions nanf and nanl   (226 Views)
In the listing of [c.math], table 108: Header synopsis I miss the following C99 functions (from 7.12.11.2): float nanf(const char *tagp); long double nanl(const char *tagp); (Note: These functions cannot be overloaded and they are also not listed anywhere else) Proposed resolution: In [c.math], table 108, section "Functions", add "nanf" and "nanl" just after the existing entry "nan" Greetings from Bremen, Daniel Krgler --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
N2369 library problem: Incomplete valarray::operator[] specification in [valarray.access]   (194 Views)
Since the return type of valarray's operator[] const overload has been changed to const T& as described in http://www.open-std.org/jtc1/sc22/wg...fects.html#389 several paragraphs of the section [valarray.access] are now incompletely specified, because many requirements and guarantees should now also apply to the const overload. Most notably, the address and reference guarantees should be extended to the const overload case. Proposed resolution: (a) Change [valarray.access]/1 from "When applied to a constant array, the subscript operator returns a reference to the corresponding element of the array. When applied to a non-constant array, the subscript operator returns a reference to the corresponding element of the array." to "The subscript operator returns a reference to the corresponding element of the array." N.B.: The 2nd sentence replicates the first one, so remove the 2nd sentence and remove the leading subordinate clause "When applied to a constant array," of the first one. (b) Change [valarray.access]/3 from "The expression &a[i+j] == &a[i] + j evaluates as true for all size_t i and size_t j such that i+j is less than the length of the non-constant array a." to "The expression &a[i+j] == &a[i] + j evaluates as true for all size_t i and size_t j such that i+j is less than the length of the array a." N.B: Remove "non-constant" from the original sentence. (c) Change [valarray.access]/4 from "Likewise, the expression &a[i] != &b[j] evaluates as true for any two non-constant arrays a and b and for any size_t i and size_t j such that i is less than the length of a and j is less than the length of b. This property indicates an absence of aliasing and may be used to advantage by optimizing compilers.281)" to "Likewise, the expression &a[i] != &b[j] evaluates as true for any two arrays a and b and for any size_t i and size_t j such that i is less than the length of a and j is less than the length of b. This property indicates an absence of aliasing and may be used to advantage by optimizing compilers.281)" N.B: Remove "non-constant" from the original sentence. (d) Change [valarray.access]/5 from "The reference returned by the subscript operator for a non-constant array is guaranteed to be valid until the member function resize(size_t, T) (26.5.2.7) is called for that array or until the lifetime of that array ends, whichever happens first." to "The reference returned by the subscript operator for an array is guaranteed to be valid until the member function resize(size_t, T) (26.5.2.7) is called for that array or until the lifetime of that array ends, whichever happens first." N.B.: Remove "non-constant" and change the leading "a" to "an" Greetings from Bremen, Daniel Krgler --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Boost library   (133 Views)
I need to implement a generic graph data structure. My options are to either write the entire code from scratch to to use the Boost graph library. What issues should I take into account to take the right decision And are there any main reasons why one should not use the Boost library At first glance, I just see only additional effort to once install the Boost libraries and to learn how to use them. But that's all. On the other hand, after this slight (beginning) overhead I have all advantages the library offer. Or do I miss something
Good thread pool library in C++   (159 Views)
Hi Could someone recommend a good thread pool library for me in C++ The software using will be targetting Windows and Linux RHEL3 platform. It doesn't seem like Boost has any,
I need some suggestions for C++ random number library   (205 Views)
The library should provide the usual random generators, such as Gamma, Wishart, Chi, Poisson distribution etc. Could somebody here kindly give me some suggestions about random generator library
exception specifications in the standard library   (154 Views)
I have been reading up on the old messages on this list (up to 8 years ago) of people discussing how exception specifications are more trouble then the value they add. My question is specifically: why does the C++ standard library have exception specifications for some of its member functions and not for others and have there been any discussions to either remove them from the standard library requirements where they exist or add them for others where they are missing The current state seems a bit haphazard. namespace std { template < class T > class numeric_limits { public : static const bool is_specialized = false ; static T min () throw (); static T max () throw (); static T infinity () throw (); static T quiet_NaN () throw (); static T signaling_NaN () throw (); ...... } namespace std { new_handler set_new_handler ( new_handler new_p ) throw (); } stl container members don't seem to have any exception specifications, also the same for many other standard library features. -------------------------------
Using a C library with C++   (158 Views)
, I'm trying to use a library (libQCCPack.a) (that I had to build with gcc) in a c++ program that I'm writing. I'm new at this and really can't figure out what I'm doing wrong. I'm working on a powerpc machine running OS X 10.4.8. When I try to compile my program: g++ -o myprogram myprogram.cpp -lQCCPack.a -L/usr/local/lib/ I get the following linking error: /usr/bin/ld: Undefined symbols: QccErrorExit() QccStringCopy(char*, char const*) QccDatasetFree(QccDataset*) QccIMGImageFree(QccIMGImage*) QccIMGImageoc(QccIMGImage*) QccIMGImageColor(QccIMGImage const*) QccIMGImageWrite(QccIMGImage*) QccErrorAddMessage(char const*, ...) QccIMGImageSetSize(QccIMGImage*, int, int) QccParseParameters(int, char**, char const*, ...) QccDatasetInitialize(QccDataset*) QccErrorPrintMessages() QccIMGImageInitialize(QccIMGImage*) QccDatasetGetBlockSize(QccDataset const*) QccDatasetReadWholefile(QccDataset*) QccIMGImageDetermineType(QccIMGImage*) QccIMGDatasetToImageComponent(QccIMGImageComponent*, QccDataset const*, int, int) QccInit(int, char**) collect2: ld returned 1 exit status If I use a C version of "myprogram" and compile as: gcc -o myprogram myprogram.c -lQCCPack.a -L/usr/local/lib/ Everything compiles and runs fine. Is there something I'm missing about using gcc compiled libraries in g++ compiled programs
Command line arguments parser library   (234 Views)
This is somewhat like a poll. The question: What is your preferred command line arguments parser library I've personally tried out boost:rogram_options, but it seems somewhat half-baked to me (just a feeling, I might be wrong). Do you use a different library Write your own
How to use iostream library to copy files   (189 Views)
How can I use iostream library in c++ to copy a file from i th byte to an output file Thank you.
Defect Report: Standard library templates and incomplete types   (189 Views)
In the latest available draft standard (N2134) 17.4.3.6 [res.on.functions] states: 1 In certain cases (replacement functions, handler functions, operations on types used to instantiate standard library template components), the C++ Standard Library depends on components supplied by a C++ program. If these components do not meet their requirements, the Standard places no requirements on the implementation. 2 In particular, the effects are undefined in the following cases: [...] - if an incomplete type (3.9) is used as a template argument when instantiating a template component. This is contradicted by 20.6.6.2/2 [util.smartptr.shared] which states: [...] The template parameter T of shared_ptr may be an incomplete type. The last bullet of 17.4.3.6/2 should be modified to allow for exceptions, as in: - if an incomplete type (3.9) is used as a template argument when instantiating a template component, unless explicitly specified otherwise. Cheers, Nicola Musatti --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
The C++ core issues list rev 42 and library issues list rev 43 are now available   (169 Views)
The core issues list rev 42 and library issues list rev 43 are now available from the WG21 web site at http://www.open-std.org/jtc1/sc22/wg21/ Best regards Keld Simonsen --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
2006-09 pre-Portland mailing available, and core and library issues lists   (253 Views)
The 2006-09 pre-Portland mailing, and the Core WG issues list R43, and Library WG issues list R44 are now available from the WG21 web site at http://www.open-std.org/jtc1/sc22/wg21/ Best regards Keld --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Logging library for C/C++ project   (150 Views)
Can someone please recommend a logging library for c/c++ I would like the logging library to do this: 1. enable/disable logging via a configure file at run time 2. have daily rolling log 3. free of charge Thank you.
How to add thread-safety in a logging library?   (132 Views)
I implemented a small logging library with the API like this: [snip] logger& log = log_manager::instance().get_logger("my_logger"); log.stream(DEBUG)
The pre San Francisco mailing and the core and library issues listsavailable   (186 Views)
The pre San Francisco mailing and the core and library issues lists in updated versions are now available from http://www.open-std.org/jtc1/sc22/wg21/ best regards Keld Simonsen
Beginnings of a new logging library [long]   (145 Views)
In some way efficient logging is a hobby of mine. I've been writing logging libraries for almost 15 years. Logging is a very good way of finding errors in your application if those errors only appear at a client's site on the other side of the planet. It also helps tremendously where errors only appear at some special timing patterns (like when you're multi-threading) which will never occur during debugging. But logging has very conflicting goals: It should be able to produce a lot of information in case of error without drowning you in a sea of useless data and, even more important, without slowing down your application. While this combination certainly cannot be achieved, a sophisticated logging system can give you the necessary tools and levers to balance between these according to your needs. (But then sophistication usually conflicts with another goal: It should be easy to use.) That's what makes logging so interesting a problem. In order to achieve maximum performance while not losing important information (which sat in some buffer when the application crashed), IME the following must hold: - for each log statement, the decision whether its data is used must be the first thing done -- at least in the code generated by the compiler - only if the data is to be used should the data be evaluated and forwarded - each log statement must be treated en-bloc, the resulting string entirely buffered in memory while it's constructed, and flushed to the target device immediately when done - it must be possible to enable/disable logging at compile-time using different parameters (severity, parts of the code etc.); if disabled, log statement should be discarded by the optimizer - if logging is enabled at compile-time, it should be possible to enable/disable it at run-time; when disabled at run-time, it should be optimized to a single 'if' statement Many people preferred the stream idiom for logging: some_logger
Linking to a global variable in a static library fails   (245 Views)
I'm using a static library in my application which links fine except for a few global variables. The static library only contains a bunch of .cpp and .h files and the global variables are defined as follows: extern unsigned mgl_numg, mgl_cur; extern float mgl_fact; extern long mgl_gen_fnt[516][6]; extern short mgl_buf_fnt[246080]; const float mgl_fgen = 4*14; extern mglTeXsymb mgl_tex_symb[]; This gives the following linker errors: 1>mathgl.lib(mgl_font.obj) : error LNK2001: unresolved external symbol "short * mgl_buf_fnt" (mgl_buf_fnt@@3PAFA) 1>mathgl.lib(mgl_font.obj) : error LNK2001: unresolved external symbol "float mgl_fact" (mgl_fact@@3MA) 1>mathgl.lib(mgl_font.obj) : error LNK2001: unresolved external symbol "struct mglTeXsymb * mgl_tex_symb" (mgl_tex_symb@@3PAUmglTeXsymb@@A) 1>mathgl.lib(mgl_font.obj) : error LNK2001: unresolved external symbol "long (* mgl_gen_fnt)[6]" (mgl_gen_fnt@@3PAY05JA) 1>mathgl.lib(mgl_font.obj) : error LNK2001: unresolved external symbol "unsigned int mgl_cur" (mgl_cur@@3IA) 1>mathgl.lib(mgl_font.obj) : error LNK2001: unresolved external symbol "unsigned int mgl_numg" (mgl_numg@@3IA) When I remove the extern keywords the linker errors are gone, except for the mgl_tex_symb[] variable. Removing the extern keyword are not an acceptable solution though since these variables are used by another .cpp file in the library. Is there something special about linking to global variables in a static library Should they be defined in the header which is included in the main program as well The library is a third party library so I do not really want to start changing things in it, hopefully this can be avoided by doing something in the header. My environment is Visual Studio 2008 and both the application and library is compiled with it.
address where shared library is loaded   (235 Views)
Hi Can someone please tell me if I can load the shared library at the given address. I do not want it to get it loaded on its own random selected address (I want to provide that). My basic requirement is to get it loaded at lower address in 64 bit machine. By default, it gets loaded at high address. Can you please tell syntax also Is it possible to feed this information within shared library itself where it gets loaded And if not, how to do that
const element type in standard library containers   (138 Views)
Program 1: --------------- #include #include #include using namespace std; int main() { vector c2; return EXIT_SUCCESS; } This program gives compilation error for the vector instantiation. Now consider the following program 2: ------------------------------------------------------- #include #include #include #include using namespace std; int main() { typedef pair p_type; multiset c1; c1.insert(make_pair(0, 2)); return EXIT_SUCCESS; } But this second program also has 'const int' as part of the element type; but it compiles fine. Why doesn't the first program compile and why does the second program compile fine Kindly clarify.