|
Lines 26-31
Link Here
|
| 26 |
# include <io.h> |
26 |
# include <io.h> |
| 27 |
#else |
27 |
#else |
| 28 |
# include <unistd.h> |
28 |
# include <unistd.h> |
|
|
29 |
# include <iconv.h> |
| 30 |
# include <langinfo.h> |
| 29 |
#endif /* WIN32 || __EMX__ */ |
31 |
#endif /* WIN32 || __EMX__ */ |
| 30 |
|
32 |
|
| 31 |
|
33 |
|
|
Lines 209-217
Link Here
|
| 209 |
NULL, printer_uri); |
211 |
NULL, printer_uri); |
| 210 |
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", |
212 |
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", |
| 211 |
NULL, cupsUser()); |
213 |
NULL, cupsUser()); |
| 212 |
if (title) |
214 |
if( title ) |
| 213 |
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL, |
215 |
{ // ÕÂÏÇÁÑ ÓÔÁÔÉÞÅÓËÁÑ ÌÏÇÉËÁ, ÎÏ ÒÁÚÂÉÒÁÔØÓÑ Ó ËÏÎÔÅËÓÔÏÍ ÎÅÄÏÓÕÇ {2017/02/08 22:17} |
| 214 |
title); |
216 |
static iconv_t CONV=(iconv_t)-1; |
|
|
217 |
static char strres[PATH_MAX*4]; |
| 218 |
|
| 219 |
if( CONV == (iconv_t)-1 ) |
| 220 |
{ // ÕÄÁÌÅÎÉÅ ÎÅ ÔÒÅÂÕÅÔÓÑ ÔÁË ËÁË ÓÏÚÄÁ£ÔÓÑ ÏÄÉÎ ÒÁÚ É ÎÁ×ÓÅÇÄÁ. îÅÆÉÇÁ ÍÅÎÑÔØ LANG ÎÅ ÌÅÔÕ ÒÁÚ ÕÖ ÐÅÞÁÔÁÅÛØ. |
| 221 |
if( (CONV = iconv_open("UTF-8",nl_langinfo(CODESET))) == (iconv_t)-1 ) title="singlejobnameerr1_alxed"; |
| 222 |
} |
| 223 |
|
| 224 |
if( CONV != (iconv_t)-1 ) |
| 225 |
{ |
| 226 |
size_t l1=strlen(title); |
| 227 |
size_t l2=sizeof(strres); |
| 228 |
char *inptr=(char*)title; |
| 229 |
char *outptr=strres; |
| 230 |
if( iconv(CONV,&inptr,&l1,&outptr,&l2) == (size_t)-1 ) title="singlejobnameerr2_alxed"; |
| 231 |
else |
| 232 |
{ |
| 233 |
strres[l2]=0; |
| 234 |
title=strres; |
| 235 |
} |
| 236 |
} |
| 237 |
|
| 238 |
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,title); |
| 239 |
} |
| 215 |
cupsEncodeOptions2(request, num_options, options, IPP_TAG_OPERATION); |
240 |
cupsEncodeOptions2(request, num_options, options, IPP_TAG_OPERATION); |
| 216 |
cupsEncodeOptions2(request, num_options, options, IPP_TAG_JOB); |
241 |
cupsEncodeOptions2(request, num_options, options, IPP_TAG_JOB); |
| 217 |
cupsEncodeOptions2(request, num_options, options, IPP_TAG_SUBSCRIPTION); |
242 |
cupsEncodeOptions2(request, num_options, options, IPP_TAG_SUBSCRIPTION); |