当前位置:网站首页>ABAP file operations involved in the Chinese character set of problems and solutions for trying to read
ABAP file operations involved in the Chinese character set of problems and solutions for trying to read
2022-08-10 13:19:00 【Wang Zixi】
In practical projects, especially some system integration projects, we often encounter scenarios where we need to receive and parse the binary stream sent from the remote end.The content of this binary stream may be some binary files, such as files in PDF, JPG and other formats, or may be text files.For text files, we need to restore the binary stream to human-readable text.This is the topic that this article will focus on.
Before starting this step, please be sure to complete the previous chapters:
How to upload local files in binary mode in ABAP report
This pre-chapter uploads the text file to the ABAP server in binary form to simulate a binary stream provided by a remote content provider (Content Provider), the type is xstring
. The actual content of these binary streams is some text containing Chinese characters. Our task in this article is to convert these binary streams back into user-readable text, and then print them out.
We create a new text file, enter a Chinese character wang
, save the file name as wang-utf8.txt
, select UTF-8 for encoding.
The size of this file is shown as 3 bytes.This is expected behavior, because UTF-8 is an implementation of Unicode, and the Unicode value of a Chinese character ranges from 0X4E00 to 0x9FA5, which requires 3 bytes if UTF-8 is encoded.
Below we will perform various operations on the text file containing this Chinese character in the ABAP code.
For a detailed introduction, please see this article.
Summary
When using ABAP to perform file operations containing Chinese characters, first of all, it must be clear which character set the current Chinese characters are encoded according to, and then find the number of the character set in the ABAP system from the ABAP database table TCP00, to ensure that the binary stream containing Chinese content matches the incoming ABAP Encoding value, so that the correct processing result can be obtained.
边栏推荐
- Ethernet channel 以太信道
- I would like to ask the big guys, how to solve this error when cdc oracle initializes a 3 million table task running
- 多线程下自旋锁设计基本思想
- 生成树协议STP(Spanning Tree Protocol)
- 11 + chrome advanced debugging skills, learn to direct efficiency increases by 666%
- 广东10个项目入选工信部2021年物联网示范项目名单
- 【jstack、jps命令使用】排查死锁
- 【百度统计】用户行为分析
- 鸿蒙开发从hello world开始
- 在web页面播放rtsp流视频(webrtc)
猜你喜欢
没有接班人,格力只剩“明珠精选”
Prada, big show?In the yuan in the universe that!
Redis上云迁移实践
10 款更先进的开源命令行工具
Nanodlp v2.2/v3.0光固化电路板,机械开关/光电开关/接近开关的接法和系统状态电平设置
bgp dual plane experiment routing strategy to control traffic
Keithley DMM7510 accurate measurement of ultra-low power consumption equipment all kinds of operation mode power consumption
【目标检测】小脚本:提取训练集图片与标签并更新索引
广东10个项目入选工信部2021年物联网示范项目名单
Shell:数组
随机推荐
漏洞管理计划的未来趋势
MySQL面试题——MySQL常见查询
shell:常用小工具(sort、uniq、tr、cut)
LeetCode·297.二叉树的序列化与反序列化·DFS·BFS
H264 码率控制
mSystems | 中农汪杰组揭示影响土壤“塑料际”微生物群落的机制
来看Prada大秀吗?在元宇宙里那种!
Proprietary cloud ABC Stack, the real strength!
瑞幸「翻身」?恐言之尚早
可视化服务编排在金融APP中的实践
一文详解 implementation api embed
Redis上云迁移实践
【目标检测】小脚本:提取训练集图片与标签并更新索引
The basic components of Loudi plant cell laboratory construction
C#WPF 图片在显示时没有问题,但在运行时图片显示不出来的解决
LeetCode·每日一题·640.求解方程·模拟构造
商汤自研机械臂,首款产品是AI下棋机器人:还请郭晶晶作代言
代码随想录笔记_动态规划_70爬楼梯
Have you guys encountered this problem?MySQL 2.2 and 2.3-SNAPSHOT are like this, it seems to be
娄底干细胞制备实验室建设须知要求