Discussion:
code for converting chinese unicode to MBCS characters
(too old to reply)
E. Rickenbacker
2003-09-17 15:07:01 UTC
Permalink
Hi,
I have an embedded application that needs to take chinese unicode
characters and convert them to multibyte characters in order to print to a
printer. The printer we use does not understand unicode but does understand
MBCS. Does anyone have code that we could look at to get an idea of how to
do this? Any information would be greatly appreciated.

Thanks,
Paul Bockisch

send email to paulbockisch@(removethistosendemail)fla-whq.com
Michael (michka) Kaplan [MS]
2003-09-17 15:54:16 UTC
Permalink
Its a simple API call -- WideCharToMultiByte with either code page 936 (for
Simplified Chinese) or 950 (for Traditional Chinese), depending on which you
want to send to the printer.
--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.
Post by E. Rickenbacker
Hi,
I have an embedded application that needs to take chinese unicode
characters and convert them to multibyte characters in order to print to a
printer. The printer we use does not understand unicode but does understand
MBCS. Does anyone have code that we could look at to get an idea of how to
do this? Any information would be greatly appreciated.
Thanks,
Paul Bockisch
E. Rickenbacker
2003-09-17 17:17:18 UTC
Permalink
I'm looking to perform the code conversion in an embedded application
running on a Motorola processor. Unfortunately, I can't use Microsoft API
calls. I need something that is portable to the Motorola processor that I'm
using.

Paul
Post by Michael (michka) Kaplan [MS]
Its a simple API call -- WideCharToMultiByte with either code page 936 (for
Simplified Chinese) or 950 (for Traditional Chinese), depending on which you
want to send to the printer.
--
MichKa [MS]
This posting is provided "AS IS" with
no warranties, and confers no rights.
Post by E. Rickenbacker
Hi,
I have an embedded application that needs to take chinese unicode
characters and convert them to multibyte characters in order to print to a
printer. The printer we use does not understand unicode but does
understand
Post by E. Rickenbacker
MBCS. Does anyone have code that we could look at to get an idea of how
to
Post by E. Rickenbacker
do this? Any information would be greatly appreciated.
Thanks,
Paul Bockisch
Jakir
2003-09-18 00:01:05 UTC
Permalink
Post by E. Rickenbacker
I'm looking to perform the code conversion in an embedded application
running on a Motorola processor. Unfortunately, I can't use Microsoft API
calls. I need something that is portable to the Motorola processor that I'm
using.
Paul
Post by Michael (michka) Kaplan [MS]
Its a simple API call -- WideCharToMultiByte with either code page 936
(for
Post by Michael (michka) Kaplan [MS]
Simplified Chinese) or 950 (for Traditional Chinese), depending on which
you
Post by Michael (michka) Kaplan [MS]
want to send to the printer.
--
MichKa [MS]
This posting is provided "AS IS" with
no warranties, and confers no rights.
Post by E. Rickenbacker
Hi,
I have an embedded application that needs to take chinese unicode
characters and convert them to multibyte characters in order to print to
a
Post by Michael (michka) Kaplan [MS]
Post by E. Rickenbacker
printer. The printer we use does not understand unicode but does
understand
Post by Michael (michka) Kaplan [MS]
Post by E. Rickenbacker
MBCS. Does anyone have code that we could look at to get an idea of how
to
Post by Michael (michka) Kaplan [MS]
Post by E. Rickenbacker
do this? Any information would be greatly appreciated.
Thanks,
Paul Bockisch
If you are getting the Unicode characters properly then you can even
call wcstomb() function this is a "C" level function which will
convert your Unicode string to MBCS. To do this you need to work on
Chinese OS. If you are not working on chinese OS then you need to set
the Locale to Chinese. To do this you have setlocale() function which
can change the locale. Once you change the locale properly then you
can call the above function which will convert your Unicode string to
MBCS

Regards
Jakir

Loading...