encoding experiment with cmgr
This commit is contained in:
parent
2b2ffb5521
commit
8e4b175579
@ -101,7 +101,13 @@ enum moo_option_t
|
||||
MOO_OPTION_SYMTAB_SIZE, /* default system table size */
|
||||
MOO_OPTION_SYSDIC_SIZE, /* default system dictionary size */
|
||||
MOO_OPTION_PROCSTK_SIZE, /* default process stack size */
|
||||
MOO_OPTION_MOD_INCTX
|
||||
MOO_OPTION_MOD_INCTX,
|
||||
|
||||
/*
|
||||
MOO_OPTION_CMGR_FS,
|
||||
MOO_OPTION_CMGR_FILE_SYS
|
||||
MOO_OPTION_CMGR_
|
||||
*/
|
||||
};
|
||||
typedef enum moo_option_t moo_option_t;
|
||||
|
||||
|
@ -442,7 +442,8 @@ static MOO_INLINE moo_ooi_t open_input (moo_t* moo, moo_ioarg_t* arg)
|
||||
const moo_bch_t* fn, * fb;
|
||||
|
||||
#if defined(MOO_OOCH_IS_UCH)
|
||||
if (moo_convootobcstr(moo, arg->name, &ucslen, MOO_NULL, &bcslen) <= -1) goto oops;
|
||||
/*if (moo_convootobcstr(moo, arg->name, &ucslen, MOO_NULL, &bcslen) <= -1) goto oops;*/
|
||||
if (moo_conv_uchars_to_bchars_with_cmgr(arg->name, &ucslen, MOO_NULL, &bcslen, moo_get_cmgr_by_id(MOO_CMGR_UTF8)) <= -1) goto oops;
|
||||
#else
|
||||
bcslen = moo_count_bcstr(arg->name);
|
||||
#endif
|
||||
@ -458,7 +459,11 @@ static MOO_INLINE moo_ooi_t open_input (moo_t* moo, moo_ioarg_t* arg)
|
||||
bb->fn = (moo_bch_t*)(bb + 1);
|
||||
moo_copy_bchars (bb->fn, fn, parlen);
|
||||
#if defined(MOO_OOCH_IS_UCH)
|
||||
moo_convootobcstr (moo, arg->name, &ucslen, &bb->fn[parlen], &bcslen);
|
||||
/* [NOTE] as i convert a unicode string for fopen() below, the conversion
|
||||
* should use the system locale instead of moo's cmgr configuration.
|
||||
* but let's not use the system locale for now. */
|
||||
/*moo_convootobcstr (moo, arg->name, &ucslen, &bb->fn[parlen], &bcslen);*/
|
||||
moo_conv_uchars_to_bchars_with_cmgr (arg->name, &ucslen, &bb->fn[parlen], &bcslen, moo_get_cmgr_by_id(MOO_CMGR_UTF8));
|
||||
#else
|
||||
moo_copy_bcstr (&bb->fn[parlen], bcslen + 1, arg->name);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user