HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Converting MBCS string to USC2 for Java client...
Operating System - HP-UX
1834926
Members
2410
Online
110071
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2000 02:06 AM
12-13-2000 02:06 AM
Converting MBCS string to USC2 for Java client.
Hello,
I have the following problem:
We have a program that is reading directories and filenames form the disk and send it to a Java client.
In the first version we used mbstowcs(...) to convert the string.
The first problem is, that the type wchar_t is 4 Bytes long. But Java wants 2 Byte wchar_t. So I truncate the upper
2 bytes of the wchar and generate an 2 byte wchar.
This works perfect for English characters. But the Java client cannot display Japanese or other characters.
The first question is, why did mbstowcs not convert to UCS2 or UCS4? Because the output of the Japanese characters
is not UCS2 or UCS4.
To solve the problem I tried to use iconv(...). For iconv I have an real Local to UCS2 converter and need no
truncation of the characters. iconv_open(...) has no problems. And the conversion of the English characters
are working perfect. But if I try to convert an Japanese string. I get the errno (251) Function not implemented.
I have installed all patches that I can get.
Nothing solves the problem.
I hope someone can help me.
I have a HP Visualize Workstation C3000 with HPUX 11.0 and all available patches.
Best regards and thanks
Jens Fauth
I have the following problem:
We have a program that is reading directories and filenames form the disk and send it to a Java client.
In the first version we used mbstowcs(...) to convert the string.
The first problem is, that the type wchar_t is 4 Bytes long. But Java wants 2 Byte wchar_t. So I truncate the upper
2 bytes of the wchar and generate an 2 byte wchar.
This works perfect for English characters. But the Java client cannot display Japanese or other characters.
The first question is, why did mbstowcs not convert to UCS2 or UCS4? Because the output of the Japanese characters
is not UCS2 or UCS4.
To solve the problem I tried to use iconv(...). For iconv I have an real Local to UCS2 converter and need no
truncation of the characters. iconv_open(...) has no problems. And the conversion of the English characters
are working perfect. But if I try to convert an Japanese string. I get the errno (251) Function not implemented.
I have installed all patches that I can get.
Nothing solves the problem.
I hope someone can help me.
I have a HP Visualize Workstation C3000 with HPUX 11.0 and all available patches.
Best regards and thanks
Jens Fauth
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2000 01:15 PM
12-13-2000 01:15 PM
Re: Converting MBCS string to USC2 for Java client.
Jens,
While ENOSYS is not specifically mentioned in the iconv(3C) manpage, this most likely indicates that you do not have the appropriate Japanese filesets installed on your system. The Japanese (and other Asian language) filesets are not included as part of the Core OS (like the European languages); these are part of the ASE (Asian Support Environment) which is installed with product B1515AA (for series 700) or B1520AA (for series 800). Once you install those, you should see the following products:
Asian-Core
Asian-Graphics
Asian-PRINTER
Asian-TERM
Asian-UTILITY
Asian-X11
Asian-X11FONT
Asian-XDEVICE
If you do already have these installed, then what locale are you trying to convert from and to? HP supports the following Japanese character sets:
eucJP
kana8
SJIS
utf8 (an encoding of ISO-10646 Unicode)
You should see the following files in /usr/lib/nls/iconv/tables:
eucJP=ucs2 sjis=ucs2 utf8=ucs2
These are the conversion tables for eucJP->UCS2, SJIS->UCS2, and UTF8->UCS2 encodings.
You can also try using the "iconv" command-line program to attempt to convert one file at a time, to see if that will provide the functionality you need.
I hope this helps.
While ENOSYS is not specifically mentioned in the iconv(3C) manpage, this most likely indicates that you do not have the appropriate Japanese filesets installed on your system. The Japanese (and other Asian language) filesets are not included as part of the Core OS (like the European languages); these are part of the ASE (Asian Support Environment) which is installed with product B1515AA (for series 700) or B1520AA (for series 800). Once you install those, you should see the following products:
Asian-Core
Asian-Graphics
Asian-PRINTER
Asian-TERM
Asian-UTILITY
Asian-X11
Asian-X11FONT
Asian-XDEVICE
If you do already have these installed, then what locale are you trying to convert from and to? HP supports the following Japanese character sets:
eucJP
kana8
SJIS
utf8 (an encoding of ISO-10646 Unicode)
You should see the following files in /usr/lib/nls/iconv/tables:
eucJP=ucs2 sjis=ucs2 utf8=ucs2
These are the conversion tables for eucJP->UCS2, SJIS->UCS2, and UTF8->UCS2 encodings.
You can also try using the "iconv" command-line program to attempt to convert one file at a time, to see if that will provide the functionality you need.
I hope this helps.
I think, therefore I am... I think!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2000 03:43 AM
12-14-2000 03:43 AM
Re: Converting MBCS string to USC2 for Java client.
Thank you for the answer.
I have checked the installation of the machine, and detected that the parts Asian-Graphics and
Asian-XDEVICE are missing. I don't know if they are necessary.
I am using ja_JP.eucJP and want to convert to UCS2.
All converter are present and iconv(1) is working. I have no idea why my program is not working.
Best regards
Jens
I have checked the installation of the machine, and detected that the parts Asian-Graphics and
Asian-XDEVICE are missing. I don't know if they are necessary.
I am using ja_JP.eucJP and want to convert to UCS2.
All converter are present and iconv(1) is working. I have no idea why my program is not working.
Best regards
Jens
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP