a datatype that can hold a character of the implementation’s character set.
Questions tagged [chars]
208 questions
2
votes
2 answers
How can I get the equivalent non-utf8 chars from a utf8 string?
ruby 1.8.6, rails 2.3.8
Im doing some evals to write some methods to a class, and its working out nice(first time playing w/ metaprogramming :p), except that some strings that need to go into the methods(as code, and not strings) have accented…

Breno Salgado
- 1,922
- 1
- 20
- 26
2
votes
3 answers
How do I change a string at position
I'm aimed at speed, must be ultra fast.
string s = something;
for (int j = 0; j < s.Length; j++)
{
if (s[j] == 'ь')
if(s.Length>(j+1))
if(s[j+1] != 'о')
…

John Black
- 21
- 3
2
votes
2 answers
Splitting a string into chunks.
I'm trying to split a string into chunks of 6 using C and I'm having a rough time of it. If you input a 12 character long string it just prints two unusual characters.
#include
#include
void stringSplit(char string[50])
{
…

WewLad
- 717
- 2
- 11
- 22
2
votes
1 answer
Polish characters receive messages imap
I have problem with Polish characters (ś,ć,ż,ź,ń,ó)
When I receive body of mail i get "??" for everyone Polish char.
MailMessage temp_message = receive.get_message(mail);
temp_message.BodyEncoding =…

Jackop
- 81
- 1
- 9
2
votes
2 answers
Add all characters except \r to new string
This is probably a very newbish question, but can I fix this so that any characters (except \r) are added to my new string ucontents? Just now it only add characters up until the \r. I want to add characters after \r too.
void…

Sam Saint-Pettersen
- 511
- 5
- 21
2
votes
2 answers
Java - How can i compare chars with other chars?
My goal is to get specific inputs from the user (A, B, C, and D only).
for example: If i enter the letter A, the if statement will execute (its not supposed to). and the same with the do while.
(Logic Error)
char[] response = new char[20];
…

Cito
- 23
- 5
2
votes
1 answer
Character digit not true when read from UTF-8 file
So im using a scanner to read a file. However i dont understand that if the file is a UTF-8 file, and the current line being read when iterating over the file, is containing a digit, the method Character.isDigit(line.charAt(0)) returns false.…

Daniel Jørgensen
- 1,183
- 2
- 19
- 42
2
votes
2 answers
String Index Out of Bounds Exception Error for password program - NO arrays allowed
I wrote a program for class with the following requirements:
Prompt a use to enter a new password.
Must be five characters in length.
Must have one upper case letter.
Must have one lower case letter.
Must have one digit.
If any of those conditions…

DevOpsSauce
- 1,319
- 1
- 20
- 52
2
votes
2 answers
Unicode characters in /bin/sh VS /bin/bash
Please try:
bash -c "printf '\u2744'"
bash -c "echo -e '\u2744'"
And so:
sh -c "printf '\u2744'"
sh -c "echo -e '\u2744'"
Why in /bin/bash I can get that unicode character but not in /bin/sh? How to print a unicode characer (for example ❄) in…

Valerio Bozz
- 1,176
- 16
- 32
2
votes
1 answer
String values look the same but don't ".equals()" each other
I'm making a log in screen. It doesn't work so I decided to display the password (saved to a file), and the inputted password to the screen for comparison.
// filePassword is the password inputted from the file as a String.
// password is the…

Michael Yaworski
- 13,410
- 19
- 69
- 97
2
votes
1 answer
simpleXML and accented characters in PHP
I have written an XML file which is using the ISO-8859-15 encoding and most of the data within the feed is ran through htmlspecialchars().
I am then using simplyxml_load_string() to retrieve the contents of the XML file to use in my script. However,…

David
- 16,246
- 34
- 103
- 162
2
votes
1 answer
Putting a line of chars from a txt-file in a vector in Matlab
I have a txt-file which looks like this
a e e a a i
i i a e u i i a
a i e i i i a i
and I want to put each line in a seperate vector (every char into one field, of course). The lines have diffrent lengths. Seems to be easy with numeric content.…

user1977830
- 23
- 3
2
votes
3 answers
BSTR and SysAllockStringByteLen() in C++
I'm new to C++, so this may be a noobish question; I have the following function:
#define SAFECOPYLEN(dest, src, maxlen) \
{ \
strncpy_s(dest,…

Mr. Smith
- 5,489
- 11
- 44
- 60
2
votes
2 answers
Array of strings (char array) in C (Arduino). How do I accomplish it?
I want to access certain data which basically looks like this:
char* a[]={
"0000000000",
"0000000000",
"0011111100",
"0000100100",
"0000100100",
"0011111100",
"0000000000",
"0000000000",
};
I have around 200 of those…

z3cko
- 3,054
- 8
- 40
- 59
2
votes
2 answers
(C++/WinAPI) Reversing LPSTR
i have some problems to reverse LPSTR.
Here is my function:
LPSTR Reverse(LPSTR a_lpText)
{
int nTextLength = strlen((char*)a_lpText);
LPSTR lpReversed = (LPSTR) GlobalAlloc(GPTR, nTextLength + 1);
for (int i = 0; i < nTextLength; ++i)
…

Memory_Leak
- 57
- 4