gpt4 book ai didi

java - 如何在java中将字符串转换为CCSID 37

转载 作者:行者123 更新时间:2023-11-30 07:48:46 24 4
gpt4 key购买 nike

我想将 java 字符串“HelloWorld”转换为 CCSID 37 数字。但我在java中找不到任何API来做到这一点。

CCSID37

最佳答案

你可以这样尝试:

String.getBytes(System.getProperty("com.ibm.cics.jvmserver.local.ccsid"))
String(bytes, System.getProperty("com.ibm.cics.jvmserver.local.ccsid"))

引用Data encoding from IBM了解详情

The JCICS API uses the code page that is specified in the CICS region and not the underlying JVM. So if the JVM uses a different file encoding, your application must handle different code pages. To help you determine which code page CICS is using, CICS provides several Java properties:

  • The com.ibm.cics.jvmserver.supplied.ccsid property returns the code page that is specified for the CICS region. By default, the JCICS API uses this code page for its character encoding. However, this value
    can be overridden in the JVM server configuration.
  • The com.ibm.cics.jvmserver.override.ccsid property returns the value of an override in the JVM profile. The value is a code page that the JCICS API uses for its character encoding, instead of the code page that is used by the CICS region.
  • The com.ibm.cics.jvmserver.local.ccsid property returns the code page that the JCICS API is using for character encoding in the JVM server.

关于java - 如何在java中将字符串转换为CCSID 37,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33560726/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com