当前位置:网站首页>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.
边栏推荐
猜你喜欢

Keithley DMM7510精准测量超低功耗设备各种运作模式功耗

瑞幸「翻身」?恐言之尚早

浙大、阿里提出DictBERT,字典描述知识增强的预训练语言模型

Ethernet channel 以太信道

Alibaba Cloud Jia Zhaohui: Cloud XR platform supports Bizhen Technology to present a virtual concert of national style sci-fi

11+ chrome高级调试技巧,学会效率直接提升666%

数字藏品,“赌”字当头

金山云要飘到哪里?

MySQL面试题——MySQL常见查询

Ethernet channel Ethernet channel
随机推荐
Fragment-hide和show
没有接班人,格力只剩“明珠精选”
NodeJs原理 - Stream(二)
多线程下自旋锁设计基本思想
Merge similar items in LeetCode simple questions
啥?他一个人写了个价值100万的软件,却用来开源了!
Loudi Cosmetics Laboratory Construction Planning Concept
Real-time data warehouse practice of Baidu user product flow and batch integration
燃炸!字节跳动成功上岸,只因刷爆LeetCode算法面试题
专有云ABC Stack,真正的实力派!
Basic knowledge of switches
娄底石油化工实验设计、建设规划概述
在web页面播放rtsp流视频(webrtc)
MySQL面试题——MySQL常见查询
LeetCode简单题之合并相似的物品
LeetCode中等题之比较版本号
M²BEV: Multi-Camera Joint 3D Detection and Segmentation with Unified Bird’s-Eye View Representation
神经网络学习-正则化
LeetCode中等题之搜索二维矩阵
娄底干细胞制备实验室建设须知要求