Hello friends,
I am currently working on something that requires taking action for diffrent chars (I mean like a,A,b,B,/,.,( etc.). I recieve text by serial (bluetooth) as a string (only this one was supporting Polish signs (ą,ę...)). Do You guys know how could I make it possible to use in a switch function? Tried to use "for" and put every letter into a char array, but when I was printing that array there were 3 first letters of sentence missing. Also the switch was not working over this array...
What makes you think that this relates "Improvements for the web system, applications to moderator, spam, etc. Use GITHUB for official reports." ?
Reported to be moved to an appropriate section.
A switch statement works on integers (note that a single character counts as integer as well) and not on text.
When using Polish characters, some are probably not a single byte (character) but take 2 or 3 bytes to be represented.
I've taken your two characters and put them in a text file; next opened the file in a hex editor
ą is 0xC4 0x85
ę is 0xC4 0x99
You can probably combine the two bytes into an integer and test for that integer.
On which character do you want to split your 'string'? Is that String with a capital S? Please provide a complete example fo the 'string' that you want to split.
Please post your code; please read the stickies to properly post (using so-called code tags if the code is small enough).