6,973 questions
-2
votes
2
answers
656
views
How to decode from ascii in rust? What's the analogue of rust's String::from_utf8()?
I have the following code:
fn handle_client(mut stream: TcpStream) -> () {
let mut buffer = [0; 4096];
stream.read(&mut buffer).expect("read fail");
let path_request: Cow&...
1
vote
1
answer
223
views
Struggling with TEA Algorithm in Assembly 8086 TASM
I’m attempting to implement the TEA algorithm in assembly language (8086 TASM). However, I’m encountering difficulties in two areas
String Input: I need assistance in implementing a mechanism to ...
1
vote
2
answers
171
views
Convert extended Ascii (>127) to standard Ascii (<128) in Java
We receive UTF-8 compliant data from a 3rd party system. Our system can handle it since it is also UTF-8 compliant. The problem is that old downstream systems can not always handle characters with a ...
-1
votes
1
answer
114
views
ASCII art probleme
I'd like your help with a program that processes text in ASCII art.
The program must write a letter or a word in the ASCII style given as input.
The problem is that the program returns me at the end ...
0
votes
1
answer
190
views
Code39 full ascii
I'm trying to configure a barcode code39 full ascii, it seems to work ok except for the char #, I've tried font libre barcode code 39, azalea font and barcode 39, all with the same result. When headed ...
0
votes
3
answers
189
views
Java. Does file-encoding affect file-comparison at the level of pure bytes?
I'm using the following to compare the content of two supposedly identical files. I've read that—at least with respect to textual files, like TXT or HTML—the encoding of a file affects how a file's ...
0
votes
2
answers
69
views
Printing an Array of Strings That Has Whitespace in it
I would like to take a string input, convert them into either lowercase or uppercase and print them. So far, I have successfuly implemented that. Now, I want to modify my program such that if the ...
0
votes
1
answer
108
views
How does this C++ manual string indexer work?
I'm pretty new to C++. This code was provided as an example to use Lambdas to index strings. ie. string "123" becomes unsigned int 123.
My issue is the main for-loop, the line starting with ...
0
votes
2
answers
326
views
Dart: how to convert Hex String to Ascii string
need some help to convert Hex String to Ascii string.
I am using sample functions from here
Sample Hex = 20354653474955
I am getting this error:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] ...
0
votes
2
answers
49
views
Convet byte[] in ASCII
I'm trying to convert a byte[] in a string but need to use the HEX column of the ASCII table.
What i have:
*byte[] byteArray = new byte [] {41,56,41};
string result = Encoding.ASCII.GetString(...
0
votes
2
answers
140
views
Why does $'\141' convert to ASCII 'a' as expected, but constructing the same string doesn't convert?
#!/bin/bash
$'\141'
string1="$'\\"
number=141
string2="'"
result="${string1}${number}${string2}"
$result
Running this script gives this response:
./temp.sh: line 2: a: ...
0
votes
2
answers
58
views
Doesnt \n remain in the buffer?
Why does the program work fine when I use only integers? After I insert a number for variable 'a' and then press enter, doesn't \n remain in the buffer? If it indeed remains, then why can I initialize ...
0
votes
0
answers
615
views
Bcrypt Password Truncation issue solution or Hashing Long Passwords with Bcrypt in Java?
In scenarios where passwords exceed the 72-byte limit of Bcrypt hashing, it becomes necessary to devise alternative approaches to ensure all input data is hashed without loss. One viable solution ...
1
vote
0
answers
144
views
C++ Bitmap to ASCII, the result is divided in half
I am writing a program that converts a 24 bit bmp file into ascii text and saves it to a txt file. I am at the very end of the project and I have a problem with saving the result to a file. I'm trying ...
2
votes
1
answer
171
views
Need help understanding weird checksum or CRC
I encountered another old serial communication reverse engineer challenge from an environment data logger.
This time the challenge is in the verification byte at the end of each transmission, like ...
1
vote
2
answers
119
views
Sort letters by ASCII and number of their occurrences in a file
I made a function that counts how many times a letter occurs in a file. I cannot figure out how to sort it by frequency, and if two letters occur the same number of times, the letter which is "...
0
votes
0
answers
189
views
Modbus address unknown Temperature controller data read by PLC
A temperature controller module sends data as RS485-Modbus Ascii code. When used putty 2400bps,parity-None,stop bit-1. Data shown as 0036 0030$* 0036 0030$* 0036 0030$* on serial monitor of putty. ...
0
votes
1
answer
457
views
Upload to openAI for fine tuning =: UnicodeEncodeError: 'ascii' codec can't encode character '\u201c' in position 7: ordinal not in range(128)
Python 3.9.12: This very simple code indented to upload a jsonl file to openAI for fine-tuning :gpt-3.5-turbo-1106 is resulting is the following error.
contents of the jsonl file being uploaded:
{&...
-1
votes
1
answer
119
views
How to convert 'unescaped string' to string in Java
Question above.
And by 'unescaped' I mean "Hello \\n \\\"World\\\"".
String myString = "Hello \\n \\\"World\\\"";
System.out.println("Before : \n");
...
1
vote
0
answers
183
views
Algolia filtering compare two strings with greater or less than
I am using Algolia for a web application using the JS SDK and I am trying to filter by
a string value using comparison operators like >, <, >=, etc...
I was expecting it to be filtering the ...
0
votes
1
answer
502
views
How to write an ascii table using Astropy without the column names?
I construct a table using Astropy as follows: data = astropy.table.Table(names=['Time', 'Rate (C/s)']). Then, I fill up the rows under the aforementioned columns using data.add_row. Finally, I intend ...
0
votes
0
answers
42
views
Hex value converts to wrong code in Python
I'm trying to use Python to send Byte stream commands to an RFID Module.
The device requires an example command:
b'\xa0\x06\x01\x72'
When I save this and print it to the console, it shows instead as:
...
0
votes
0
answers
239
views
Number to ascii in armv8 assembly
I need help converting numbers to ASCII. This is my code so far:
.global itoascii
itoascii:
/* Initialize variables */
mov x1, #10 /* Divisor */
mov x2, buffer /*...
-1
votes
3
answers
155
views
How would I format console output in python correctly?
from colorama import Fore
import platform
import distro
import time
import os
# Functions
def get_uptime():
return os.popen('uptime -p').read()[:-1]
def get_os():
return platform.system() + &...
0
votes
1
answer
78
views
Charset Conversion € \x80
I'm sure I'm missing something obvious here but I have a string that at a certain point has the € and I know that this means the next section repeats 128 times or if the character is 7 then it repeats ...