6,973 questions
1
vote
1
answer
77
views
How to turn numbers to their relevant letters?
I'm creating a Microsoft Access program and I have a calculated column that looks like this:
Round([chance]/20)
I've tried adding in the ascii tab
Ascii(Round([chance]/20))
and its making a set of ...
0
votes
0
answers
130
views
incorrectly read floats with fscanf [closed]
I am writing a code using Virtual C IDE that is to read in a text file with hundreds of lines, each containing a date, time, and eight floats; all these are assigned to arrays of according variables. ...
Advice
2
votes
5
replies
140
views
How to use space as an delimiter when the entire string is made up of spaces?
I've written a program that takes in a text then prints the binary translation of it. İts been working perfectly fine until I tried the case where entire string is just made up of spaces. As to ...
Best practices
0
votes
4
replies
123
views
How to search through Unicode text with ASCII input in Python
I have a corpus of text which includes some accented words, such as épée, and I would like people to be able to easily search through it using ASCII input. Ideally, they would simply type protege or ...
1
vote
1
answer
109
views
Why are Grep highlight sequences not read with `pty`?
I was experimenting with creack/pty while learning about pseudo terminals.
I spawned grep and hooked it up with a pseudo terminal device as follows:
package main
import (
"fmt"
&...
2
votes
2
answers
273
views
Why does my ASCII animation keep scrolling down instead of updating in place on Windows console?
I’m trying to create a simple ASCII 3D spinning cube animation in the Windows console using C++:
#include <iostream>
#include <cmath>
#include <cstring>
#include <windows.h>
#...
2
votes
0
answers
100
views
Bypassing C64's PETSCII to screen code mapping
In upper-case mode, the C64 PRINT ASC("A") prints 65 - the ASCII/PETSCII code.
But POKE 1024,65 prints the shifted A character. PRINT CHR$(65), however, prints the proper 'A' character.
With ...
3
votes
1
answer
224
views
Delphi tstringlist encoding default
I have noticed recently (maybe a change in recent Delphi) that if I load an ASCII format txt file into a tstringlist, edit a line with file.lines[10]:='blah', and then save it again the file is now ...
0
votes
1
answer
182
views
How to use character arrays with Win32 APIs in C++ Builder 12
I am experimenting with C++Builder 12, trying to port some old code from C++Builder 2009.
In that old code, all character strings are defined, for example, like this:
char testString[256]="This ...
1
vote
0
answers
72
views
printer italic font ascii (no html tags os font styles)
We are using citizen/HP printer to print receipt.
to print Bold characters uses following code
string Bold = Escape + (char) 33; // u001b!
string BoldStart = Bold + (char)8;// u001b!\b
string BoldEnd =...
0
votes
7
answers
316
views
How does '0' + (n % 10) convert an integer digit to its character representation in C?
I'm learning about converting numbers to characters in C, and I came across the expression:
char c = '0' + (n % 10);
I understand that '0' is a character and n % 10 extracts the last digit of a ...
-1
votes
2
answers
157
views
convert a VHDL string to an integer ascii equivalent
Suppose I have VHDL code that has a generic string STACK with the value "top". I want to pass it to a SystemVerilog module as a parameter, but SV does not have a type compatible with VHDL ...
0
votes
1
answer
76
views
glib iconv() - force conversion to single bytes
I have my own personal movie database system, within which context I NEVER want to see "extended" characters (with accents, umlauts, etc.) in any text fields.
MS Co-pilot tells me that i ...
3
votes
1
answer
124
views
Is `0x1F` an ASCII scan code, and if so, how is it repeatable?
I am writing a CLI text editor in c. I have to handle a lot of CTRL+key inputs. Right now, I am using a macro that gets the key you want to pair with CTRL, like this: #define CTRL(key) ((key) & ...
0
votes
1
answer
84
views
How can I get this IAS assembly code to work properly?
I'm doing this for a school assignment I've been given in Computer Architecture.
The topic is on the Von Neuman Machine (The IAS) and we were tasked to create a program that can do whatever we wanted.
...
1
vote
0
answers
100
views
Cannot read data from the digital force gauge by using Pyserial
I want to get force values from a digital force gauge which has a RS232 port. According to the FH Data Connection protocol, if I send ASCII '9' by using Pyserial, the device should send the force ...
0
votes
1
answer
133
views
Trying to connect to a UART CO2 sensor to to get readings using a python script but I can't get any responses following command
I'm using this specific CO2 sensor:
https://www.co2meter.com/products/sprintir6s-100-co2-smart-sensor?variant=43960919195846
for a school project and ultimately I'm trying get it connected to a ...
0
votes
1
answer
52
views
FileReader.readAsArrayBuffer handling of non-ASCII including £ (pound sterling)
I am using FileReader.readAsArrayBuffer(file) and converting the result into a Uint8Array.
If the text file input contains a pound sterling sign (£), then this single character results in two byte ...
0
votes
1
answer
234
views
Find different language characters in Snowflake SQL
I have a table that has a text document as one of the columns. These text documents can have about 500-100 words which may contain special characters. I want to find if any of these documents (or ...
2
votes
2
answers
115
views
Using regex in Postgres for special characters
I'm using in Postgres 17.1 on Ubuntu.
I want to understand the regex for characters - what is the difference between:
1. delete from tablea where col~'^[\u2611-\uffffff]+$'
2. delete from tablea ...
-1
votes
3
answers
99
views
How does Linux (via SYS_WRITE) deal with the ASCII (control) codes from 0 to 31?
This recent assembly question got my attention, not for the obviously redundant instructions, but for what the sys_write outputs.
The program tries to output all 256 ASCII characters and does so ...
-1
votes
2
answers
150
views
Convert ASCII string to integer for registry key (WmiMonitorID.UserFriendlyName)
im trying to get a powershell script to query display EDID info and put it into a reg key. when trying to add the key, it says its not found, but the reg key tree exists. it turns out that all the ...
0
votes
2
answers
56
views
How to check whether a s3 object is in ASCII text
When we want to check whether a file is ASCII text file, we can use this command
~$ file some_file_content_unknown
some_file_content_unknown: ASCII text
Is it possible to use file command to ...
2
votes
1
answer
145
views
Identifying ASCII characters in a UTF-8 byte stream
Reading bytes from a UTF-8 file (i.e. not processing strings), I need to unambiguously identify certain ASCII characters which are used as delimiters - much like CSV parsing.
While this seems simple ...
0
votes
0
answers
21
views
Barcode scanner replace text in texbox
I was trying to generate a 128A barcode that backspaces and then inserts the numbers inside the barcode.
Example \x0155\n
So, the Zebra RF:
When the barcode is scanned this happens:
-deletes a ...
4
votes
3
answers
222
views
How to enforce ASCII-only identifiers in Python while allowing UTF-8 strings?
I want to configure Python so that it raises an error when encountering non-ASCII characters in identifiers (e.g., variable names, function names) but still accepts UTF-8 encoded strings (e.g., "...
0
votes
0
answers
98
views
Swift ASCII string fails, but works in Objective-C
I'm converting some code from Objective-C to Swift and I have a very simple function that reads text from a file into a string.
@implementation DecodeFile
- (NSString * _Nullable)readFile:(nonnull ...
-1
votes
1
answer
110
views
How to read text file strictly as 256 character ASCII
I am trying to read a game data file from an old windows RPG in order to create an editor program. The code reads each character as its ASCII value. The files are in 256 character ASCII, but when I ...
0
votes
1
answer
70
views
How to pass UNICODE characters in a url? [duplicate]
I am attempting my first steps in web dev with Django. Can anybody help me modify somehow the paths so that <slug:slug> works for Unicode characters, not only ASCII?
from django.urls import path
...
0
votes
0
answers
66
views
How to get greek letters with getline in c++? [duplicate]
I have been spending hours trying to make this work:
std::wstring string;
getline(std::wcin, string);
I also tried to store the string in std::string which is the classic char and then ...
2
votes
3
answers
398
views
PowerShell, distinguish between files that are text or binary in nature
I have a script that will look through all files in some folders and then search for text inside them. The problem is that I want it to selectively only search through files that are not binary in ...
1
vote
1
answer
585
views
The from_utf8 Rust function cannot read some ASCII strings (invalid utf-8 sequence of 1 bytes)
I am trying to convert a vector of ASCII bytes into a rust string. I found the std::str::from_utf8() function, that should be able to handle all ASCII strings. For some reason it cannot read the ...
1
vote
1
answer
59
views
How to optimize the output of a large number of characters on the console?
I am developing a program that plays video in the console using ascii characters.
This is an example of such a program text
To calculate the correct characters, I use opencl for parallelization.
Here ...
1
vote
3
answers
185
views
Return control character as number
so I'm trying to print every keypress as an integer and character referencing to ASCII code. and it seems I can't print some of control character.
After reading antirez's booklet about his kilo text ...
0
votes
1
answer
88
views
I replaced < with <, but it renders as < [duplicate]
I'm using vanilla JavaScript to help me prepare some text for injection into an HTML page.
The script takes a bunch of text strings (words and part-words), adds links around each one, and puts them in ...
3
votes
3
answers
214
views
ASCII file encoding with 16-bit bytes
According to the C standard, a byte can have more than 8 bits. How is an ASCII (or UTF-8) file encoded on systems with, e.g., 16-bit bytes since ASCII characters take up 8 (technically 7) bits? Does ...
1
vote
1
answer
140
views
Delphi 11 - controlling interaction between ASCII and UTF-8 in TStrings eg. in Memo
If I copy and paste some UTF-8 text [eg. “Wands!”] into a TMemo, it displays as expected.
If I generate a string containing the 3 bytes (as characters) for '“' (ie 0xE2, 0x80, 0x9C) and use Memo1....
-1
votes
2
answers
99
views
Detecting and converting string containing ASCII [closed]
I have this string:
Miami, Florida
I would like to find a regex to help defect to see if this string contains ASCII code.
I have tried these regex \\p{ASCII}, ^[\\u0000-\\u007F]*$, ^\p{ASCII}*...
2
votes
1
answer
236
views
How to check for the "0-31 (ASCII control characters)" in python? (using regex if possible) [duplicate]
I'm dealing with a program that will have the user typing into a entry widget, then the name will be checked to see if it is valid. If it is, the file gets renamed, if not, [something else happens].
...
1
vote
2
answers
96
views
npm list show results using incorrect characters
I run npm list command in powershell (v. 7.4.4) or cmd.exe and I get the result in this way:
npm -g list --depth=0
C:\\Program Files\\nodejs -\> .\
+-- @angular/[email protected]
+-- ...
-1
votes
1
answer
91
views
how i can use ascii code for send to serial port
I am beginner to C#, could anyone help me?
I want to send code to my board
now I am using ModBus Poll application, with modeBus Poll i got this Ascii code :
3A 30 31 30 36 30 30 30 30 30 30 30 30 46 ...
0
votes
1
answer
284
views
sending command to VideoJet 2351 printer using TCP/IP
its my first question on this forum, so im sorry if i made any mistakes in its review.
Im trying to set a connection and send a command to printer, using this code:
import socket
# Connection options
...
0
votes
3
answers
223
views
Decimal -> HexaDecimal -> Character Encoding in XSLT
(1) My requirement is to convert a DECIMAL INPUT to hexadecimal notation with fixed 8 digits
(2) Convert/Map HEXADECIMAL RESULT to character set by picking 2 HEXADECIMAL characters at a time and ...
0
votes
0
answers
57
views
Disable comment function on Word Press when in Cyrillic
Lately I'm facing some spam messages on one of my Word Press blogs.
The comments are coming from different IPs all over the world, but what they have in common, they are all in Cyrillic.
Now, I was ...
-1
votes
1
answer
129
views
SciLab: csvRead() is reading all the columns of data in my csv file as one column meaning i cant index specific columns
Quite new to Scilab so struggling a bit with this, I have data imported from an oscilloscope as a csv file, I need to manipulate this data so I'm importing it with csvRead() but when I do this it is ...
0
votes
1
answer
75
views
Oracle XML Parse Error specific to non printable character
My XML Query goes like this.
SELECT X.CODE_VAL, X.CODE_DESC
FROM DATA_TBL A, XML_TBL B,
XMLTABLE('/XPATH/CHILDNODE1/CHILDNODE2' PASSING XMLTYPE(XML_TBL.XMLSTRING_TXT) COLUMNS
CODE_VAL VARCHAR2(100) ...
1
vote
0
answers
118
views
Handling ASCII Encoding Error When Saving TIFF Files in Python
I'm working on a Python script that processes images and saves them as TIFF files using the tifffile library. The script runs as part of a larger pipeline where I use the ashlar tool to process these ...
0
votes
1
answer
98
views
Extended ASCII character from Omron NJ PLC to Sato printer
I am using an Omron NJ PLC, with which I send a string to a Sato printer using TCP socket communication. I can print 'normal' text by sending ASCII characters, but when I want to print something like ...
1
vote
1
answer
78
views
Hex to Ascii doubling the length count
When I convert the hex value to ASCII and pass on the ASCII to textField, it doubles the text length. Below is the conversion I used and if you see from the screenshot, the total characters for both ...
0
votes
1
answer
306
views
How do I process text from the tty to obtain a txt with control characters applied to it?
I have a bashrc setup where I run a script command every time I open a session that writes to an output file as I write in the terminal.
The files that script produces contain all interactions with ...