comparison sidutil.c @ 356:811eb6c6695e

Add "support" for CP858 output in fallback converter as it is essentially the same as CP850.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 27 Jan 2020 02:32:59 +0200
parents 9924d4518932
children 199284ba94ea
comparison
equal deleted inserted replaced
355:9924d4518932 356:811eb6c6695e
207 if (!th_strbuf_putch(&outBuf, &outSize, &outLen, *srcPtr)) 207 if (!th_strbuf_putch(&outBuf, &outSize, &outLen, *srcPtr))
208 goto err; 208 goto err;
209 break; 209 break;
210 210
211 case TH_LANG_CP850: 211 case TH_LANG_CP850:
212 case TH_LANG_CP858:
212 case TH_LANG_CP437: 213 case TH_LANG_CP437:
213 // Not 100% correct either, but close enough 214 // Not 100% correct either, but close enough
214 convTable = (ctx->outLangID == TH_LANG_CP850) ? 215 convTab = (ctx->outLangID == TH_LANG_CP437) ?
215 sidutil_lang_iso88591_to_cp850 : sidutil_lang_iso88591_to_cp437; 216 sidutil_lang_iso88591_to_cp437 :
217 sidutil_lang_iso88591_to_cp850;
216 218
217 if (*srcPtr < 0x7f) 219 if (*srcPtr < 0x7f)
218 outByte = *srcPtr; 220 outByte = *srcPtr;
219 else 221 else
220 if (*srcPtr >= 0xA0) 222 if (*srcPtr >= 0xA0)
312 ctx->outLangID = TH_LANG_ISO88591; 314 ctx->outLangID = TH_LANG_ISO88591;
313 else 315 else
314 if (strcmp(ctx->outLang, "cp850") == 0) 316 if (strcmp(ctx->outLang, "cp850") == 0)
315 ctx->outLangID = TH_LANG_CP850; 317 ctx->outLangID = TH_LANG_CP850;
316 else 318 else
319 if (strcmp(ctx->outLang, "cp858") == 0)
320 ctx->outLangID = TH_LANG_CP858;
321 else
317 if (strcmp(ctx->outLang, "cp437") == 0) 322 if (strcmp(ctx->outLang, "cp437") == 0)
318 ctx->outLangID = TH_LANG_CP437; 323 ctx->outLangID = TH_LANG_CP437;
319 else 324 else
320 ctx->outLangID = TH_LANG_ISO88591; 325 ctx->outLangID = TH_LANG_ISO88591;
321 326