ascii

c++打印ascii码表--cout版

…衆ロ難τιáo~ 提交于 2020-01-29 23:14:19
/* * C++ Program to Print ASCII table (0 - 127) */ #include<iostream> #include<iomanip> using namespace std; char const* character[] = {"NULL(空)", "SOH(标题开始)", "STX(正文开始)", "ETX (正文结束)", "EOT (传送结束)", "ENQ (询问)", "ACK (确认)", "\\a","\\b","\\t","\\n","\\v","\\f","\\r","SO(移出)","SI(移入)", "DLE(退出数据链)", "DC1 (设备控制1)", "DC2(设备控制2)", "DC3(设备控制3)", "DC4(设备控制4)", "NAK (反确认)", "SYN (同步空闲)", "ETB (传输块结束)", "CAN (取消)", "EM (媒介结束)", "SUB (替换)", "ESC (退出)", "FS (文件分隔符)", "GS (组分隔符)", "RS (记录分隔符)", "US (单元分隔符)", "(空格)"}; int main() { char c; int row; cout << " ASCII Table" << endl << "=============" << endl;

STM32串口 ASCII 的数字接收与发收

白昼怎懂夜的黑 提交于 2020-01-29 05:32:06
STM32 ASCII 的数字接收与发收 STM32串口 ASCII 的数字接收与发收 串口发送 先重定义,如下 int fputc ( int ch , FILE * f ) { HAL_UART_Transmit ( & huart1 , ( uint8_t * ) & ch , 1 , 1 ) ; return ch ; } 数据量大的可用DMA,亲测有效 int fputc ( int ch , FILE * f ) { while ( HAL_UART_Transmit_DMA ( & huart1 , ( uint8_t * ) & ch , 1 ) != HAL_OK ) ; return ch ; } 发送的内容用printf即可 串口的数字接收 接收ASCII的数字并组合,此函数可处理 有小数的正负和无小数的正负 //此函数用于接收ascii码的数字,可方便后续的计算 /* uint8_t *rxbuffer 存放数据的数组 */ float readstring ( uint8_t * rxbuffer ) { float str = 0 ; //返回的变量 int sum = 0 ; float t = 0 , c = 0 , z = 0 , a = - 1 ; //作为中间变量 uint8_t flag = 0 ; //做标记位,判断有无小数点 for (

ASCII non readable characters 28, 29 31

走远了吗. 提交于 2020-01-28 01:49:48
问题 I am processing a file which I need to split based on the separator. The following code shows the separators defined for the files I am processing private static final String component = Character.toString((char) 31); private static final String data = Character.toString((char) 29); private static final String segment = Character.toString((char) 28); Can someone please explain the significance of these specific separators? Looking at the ASCII codes, these separators are file, group and unit

什么是二进制文件

谁说我不能喝 提交于 2020-01-27 06:52:30
转自: https://baike.baidu.com/item/%E4%BA%8C%E8%BF%9B%E5%88%B6%E6%96%87%E4%BB%B6/996661 包含在 ASCII 及扩展 ASCII 字符 中编写的数据或程序指令的文件。 计算机文件 基本上分为二种:二进制文件和 ASCII(也称 纯文本文件 ),图形文件及文字处理程序等 计算机程序 都属于二进制文件。这些文件含有特殊的格式及计算机代码。ASCII 则是可以用任何文字处理程序阅读的简单文本文件。 中文名 二进制文件 外文名 BINary files 外国语缩写 BIN(作 文件扩展名 ) 目录 1 定义 2 使用二进制文件的好处 3 二进制文件的储存方式 4 如何使用语句操作二进制文件 5 用例 定义 广义的二进制文件即指文件,由文件在 外部设备 的存放形式为二进制而得名。狭义的二进制文件即除文本文件以外的文件。文本文件是一种由很多行 字符 构成的 计算机文件 。文本文件存在于 计算机系统 中,通常在文本文件最后一行放置文件结束标志。文本文件的 编码 基于字符定长, 译码 相对要容易一些;二进制文件 编码 是变长的,灵活利用率要高,而译码要难一些,不同的二进制文件译码方式是不同的。 从本质上来说他们之间没有什么区别,因为他们在 硬盘 上都有一种的存放方式--二进制,但是如果要对他们有些区分的话

java实现参数名ASCII字典序排序并MD5加密

狂风中的少年 提交于 2020-01-27 03:06:54
package com.example.demo_java8_new_characteristic.test; import org.apache.commons.lang.StringUtils; import java.security.MessageDigest; import java.util.*; public class MD5Utils { /** * sign 签名 (参数名按ASCII码从小到大排序(字典序)+key+MD5+转大写签名) * @param map * @return */ public static String encodeSign(SortedMap<String,String> map, String key){ if(StringUtils.isEmpty(key)){ throw new RuntimeException("签名key不能为空"); } Set<Map.Entry<String, String>> entries = map.entrySet(); Iterator<Map.Entry<String, String>> iterator = entries.iterator(); List<String> values =new ArrayList(); while(iterator.hasNext()){ Map

1042:奇偶ASCII值判断

折月煮酒 提交于 2020-01-25 09:40:22
【题目描述】 任意输入一个字符,判断其 A S C I I 是否是奇数,若是,输出 Y E S ,否则,输出 N O 。例如,字符 A 的 A S C I I 值是65,则输出 Y E S ,若输入字符 B ( A S C I I 值是66),则输出 N O 。 【输入】 输入一个字符。 【输出】 如果其 A S C I I 值为奇数,则输出 Y E S ,否则,输出 N O 。 【输入样例】 A 【输出样例】 YES #if(1) #include <iostream> #define A 1000000+5 using namespace std; int i,j; int a[A]={0,1,2}; bool judge(int); int main() { char n; cin>>n; if(judge((int)n)) { cout<<"YES"<<endl; } else cout<<"NO"<<endl; return 0; } bool judge(int n) { if(n%2!=0)return true; return false; } #endif 来源: CSDN 作者: C_Dreamy 链接: https://blog.csdn.net/C_Dreamy/article/details/104055724

SMS PDU Encoding for characters like “é, è, à, @”

一世执手 提交于 2020-01-25 06:51:26
问题 I am working on SMS PDU encoding in C. I am able to convert 7-bit ASCII characters into 8 bit PDU. But when I try to use characters like "é, à, è, @" it doesn't show it's correct value. How can I encode these characters? I am using GSM 7 bit encoding. I am attaching the code. what changes should I do to convert these characters? #include <stdio.h> #include <string.h> #include <time.h> enum { SMS_MAX_PDU_LENGTH = 256 }; enum { BITMASK_7BITS = 0x7F, BITMASK_8BITS = 0xFF, BITMASK_HIGH_4BITS =

Python - Convert bytes / unicode tab delimited data to csv file

一个人想着一个人 提交于 2020-01-24 18:59:06
问题 I'm pulling the following line of data from an API. The data starts with a b prefix which would indicate according to the Python 3.3 documentation that we are dealing with "a bytes literal" with the escape sequences \t and \n representing the ASCII Horizontal Tab (TAB) and ASCII Linefeed (LF) respectively. b'settlement-id\tsettlement-start-date\tsettlement-end-date\tdeposit-date\ttotal-amount\tcurrency\ttransaction-type\torder-id\tmerchant-order-id\tadjustment-id\tshipment-id\tmarketplace

python——字符输出ASCII码

こ雲淡風輕ζ 提交于 2020-01-24 16:46:07
  总是忘记事,赶紧记下来,Python字符转成ASCII需要用到一个函数ord 1 # 用户输入字符 2 ch = input("请输入一个字符: ") 3 4 # 用户输入ASCII码,并将输入的数字转为整型 5 uch = int(input("请输入一个ASCII码: ")) 6 7 print( ch + " 的ASCII 码为", ord(ch)) 8 print( uch , " 对应的字符为", chr(uch)) 来源: https://www.cnblogs.com/daker-code/p/12232292.html

.Net Regex ValidationExpression ASCII

让人想犯罪 __ 提交于 2020-01-23 20:30:28
问题 Anyone know a good Regex expression to drop in the ValidationExpression to be sure that my users are only entering ASCII characters? <asp:RegularExpressionValidator id="myRegex" runat="server" ControlToValidate="txtName" ValidationExpression="???" ErrorMessage="Non-ASCII Characters" Display="Dynamic" /> 回答1: One thing you may want to watch out for is the lower part of the ascii table has a lot of control characters which can cause funky results. Here's the expression I use to only allow "non