... just wanted to remind the obvious: you can certainly avoid a lot of "black-box" experiments, because you are dealing with free software: just fetch the sources and browse libstdc++-v3/config/locale/gnu/coodecvt_member.cc: together with the wcsnrtombs and mbsnrtowcs man pages you have all there is to it. Paolo.