Commit 14285d7548615626e5c5ffd5a39e264bcb302cee
1 parent
288c67b4
Exists in
master
and in
3 other branches
Incluindo conversão ebcdic<->asc no módulo rexx
Showing
1 changed file
with
31 additions
and
0 deletions
Show diff stats
charset.c
... | ... | @@ -402,6 +402,37 @@ LIB3270_ACTION( charsettable ) |
402 | 402 | return 0; |
403 | 403 | } |
404 | 404 | |
405 | +LIB3270_EXPORT const char * lib3270_asc2ebc(H3270 *hSession, unsigned char *buffer, size_t sz) | |
406 | +{ | |
407 | + int f; | |
408 | + if(sz < 0) | |
409 | + sz = strlen((const char *) buffer); | |
410 | + | |
411 | + if(sz > 0) | |
412 | + { | |
413 | + for(f=0;f<sz;f++) | |
414 | + buffer[f] = hSession->charset.asc2ebc[buffer[f]]; | |
415 | + } | |
416 | + | |
417 | + return (const char *) buffer; | |
418 | +} | |
419 | + | |
420 | +LIB3270_EXPORT const char * lib3270_ebc2asc(H3270 *hSession, unsigned char *buffer, size_t sz) | |
421 | +{ | |
422 | + int f; | |
423 | + if(sz < 0) | |
424 | + sz = strlen((const char *) buffer); | |
425 | + | |
426 | + if(sz > 0) | |
427 | + { | |
428 | + for(f=0;f<sz;f++) | |
429 | + buffer[f] = hSession->charset.ebc2asc[buffer[f]]; | |
430 | + } | |
431 | + | |
432 | + return (const char *) buffer; | |
433 | +} | |
434 | + | |
435 | + | |
405 | 436 | // Process a single character definition. |
406 | 437 | LIB3270_EXPORT void lib3270_remap(H3270 *hSession, unsigned short ebc, unsigned short iso, lib3270_remap_scope scope, unsigned char one_way) |
407 | 438 | { | ... | ... |