- converter = ucnv_open(encoding, &status);
- if (U_FAILURE(status)) {
- fprintf(stderr, "%s: couldn't create %s converter for encoding\n", pname, encoding ? encoding : ucnv_getDefaultName());
- return 2;
- }
- ucnv_setFromUCallBack(converter, UCNV_FROM_U_CALLBACK_ESCAPE, UCNV_ESCAPE_C, 0, 0, &status);
- if (U_FAILURE(status)) {
- fprintf(stderr, "%s: couldn't configure converter for encoding\n", pname);
- return 3;
- }
-
- defaultConverter = ucnv_open(0, &status);
- if (U_FAILURE(status)) {
- fprintf(stderr, "%s: couldn't create %s converter for encoding\n", ucnv_getDefaultName(), pname);
- return 2;
- }
+ fflush(stderr); // use ustderr now.
+ ustderr = u_finit(stderr, NULL, NULL);