Question marks around text where quotations are supposed to be

so im kind of confused right now, Im not sure why there are question marks on the side of the text, it's supposed to be quotations like "Chlorine"

it didn't want to upload my image as an attachment so here it is:

they way I have this setup is that a program runs on the pc that reads a .txt file and then outputs that through serial to the Arduino and then the Arduino displays that on the OLED. I feel like its either that the quotations cant be used with serial or the Arduino cant display them properly. I really dont have much experience with this so im kind of stumped.

contents of .txt file:
“Chlorine” by Twenty One Pilots

Visual Studio code is written in C#
(im still working on this so it is very messy at the moment)

using System;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
using System.IO.Ports;
using System.Threading;


namespace NotifyConsole
{
    class Program
    {
        private System.Windows.Forms.NotifyIcon notifyIcon1;
        private System.Windows.Forms.ContextMenu contextMenu1;
        private System.Windows.Forms.MenuItem menuItem1;
        private System.ComponentModel.IContainer components;


        static void Main(string[] args)
        {
            Program pg = new Program();
            //Application.Run();
            Console.ReadLine();
            string text = System.IO.File.ReadAllText(@"C:\Users\Public\TestFolder\WriteText.txt");

            //for (int i = 1; i > 0; i++)
            //{
            //    System.Console.WriteLine(text);
            //    Thread.Sleep(3000);
            //}
            SerialPort mySerialPort = new SerialPort("COM11", 9600);
            try
            {
                mySerialPort.Open();

                mySerialPort.Write(text);
            }
            catch (IOException ex)
            {
                Console.WriteLine(ex);
            }

            mySerialPort.Close();

        }

        private void menuItem1_Click(object Sender, EventArgs e)
        {
            //Application.Exit();
        }

        Program()
        {
            CreateNotifyicon();
        }
        private void CreateNotifyicon()
        {
            this.components = new System.ComponentModel.Container();
            this.contextMenu1 = new System.Windows.Forms.ContextMenu();
            this.menuItem1 = new System.Windows.Forms.MenuItem();
            this.menuItem1.Index = 0;
            this.menuItem1.Text = "E&xit";
            this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);
            this.contextMenu1.MenuItems.AddRange(
                        new System.Windows.Forms.MenuItem[] { this.menuItem1 });
            this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
            notifyIcon1.Icon = new Icon("avatar.ico");
            notifyIcon1.ContextMenu = this.contextMenu1;
            notifyIcon1.Text = "Spotduino";
            notifyIcon1.Visible = true;
            string text = System.IO.File.ReadAllText(@"C:\Users\Public\TestFolder\WriteText.txt");

            string[] lines = { text };
            //System.IO.File.WriteAllLines(@"C:\Users\Public\TestFolder\WriteLines.txt", lines);
            //System.Console.WriteLine(text);
            //for (int i = 1; i > 0; i++)
            //{
            //   System.IO.File.WriteAllLines(@"C:\Users\Public\TestFolder\WriteLines.txt", lines);
            //    System.Console.WriteLine(text);
            //    Thread.Sleep(3000);
            //}
        }
    }
}

Arduino code:

#include <SPI.h>
#include <Wire.h>

#include <Adafruit_GFX.h>

#include <Adafruit_SSD1306.h>

#define OLED_RESET 4

Adafruit_SSD1306 display(OLED_RESET);

#define NUMFLAKES 10

#define XPOS 0

#define YPOS 1

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels

void setup() {

Serial.begin(9600);

display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64) // init done // Show image buffer on the display hardware.

display.display(); //delay(2000);

display.setTextSize(1);

display.setTextColor(WHITE);

display.setCursor(0, 10);

display.clearDisplay();

// invert the display

display.invertDisplay(true);

display.invertDisplay(false);

display.display();

display.clearDisplay(); }

void loop() {

while (1) {

display.setTextSize(1);

display.setTextColor(WHITE);

display.setCursor(0, 10);

display.clearDisplay();

printText();

display.display();

}

}

void printText(void) {

String s;

if (Serial.available()) {

s = Serial.readString(); //getting string input in variable "s"

display.println(s);

display.display();

display.println("\n");

delay(20000);

  }

}

IcyBlade:
it didn't want to upload my image as an attachment so here it is:

Unfortunately, that is a particularly inconvenient place to put images. There would be a reason why "it didn't want to upload my image as an attachment". What did the forum tell you?

Generally, the reason for the question marks is that the device - either the display or the library - has encountered a character for which it does not have a font image, generally because the character you sent was not ASCII, for example something pasted from a word processor which uses a different set of quotation characters.

I think it's caused by the "fancy quotes" you're using. I can't see them on the forum, but I can see them in the email notification I got for this post. My guess is this character has not been created in the display library, so it just uses the question marks as a placeholder. You can test this by changing the .txt file to use normal quotes. Be sure to use a text editor designed for programming, as some word processing programs have the annoying behavior of automatically replacing regular quotes with "fancy quotes".

Paul__B:
Unfortunately, that is a particularly inconvenient place to put images. There would be a reason why "it didn't want to upload my image as an attachment". What did the forum tell you?

Generally, the reason for the question marks is that the device - either the display or the library - has encountered a character for which it does not have a font image, generally because the character you sent was not ASCII, for example something pasted from a word processor which uses a different set of quotation characters.

well, I originally downloaded it as a png and tried to upload that but it said it encountered an error so I just put it there because I use sharable g-drive links for like everything I need to show people.

is there a way to be able to add that set of quotation marks to the library?

pert:
I think it's caused by the "fancy quotes" you're using. I can't see them on the forum, but I can see them in the email notification I got for this post. My guess is this character has not been created in the display library, so it just uses the question marks as a placeholder. You can test this by changing the .txt file to use normal quotes. Be sure to use a text editor designed for programming, as some word processing programs have the annoying behavior of automatically replacing regular quotes with "fancy quotes".

is there a way I could add the fancy quotes to the library myself? I can't change them in the .txt because the .txt is made by another program I dont own and dont have the source code for so I can't change it that way and there isn't an option to change what it outputs in the program.

IcyBlade:
is there a way I could add the fancy quotes to the library myself? I can't change them in the .txt because the .txt is made by another program I don't own and don't have the source code for so I can't change it that way and there isn't an option to change what it outputs in the program.

Start by verifying that when you write the quotes into the Arduino program itself, that they do indeed show on the display as quotes.

Then figure out what the spurious characters are - they may either be "high-bit" characters with the eighth bit set, or just possibly Unicode characters which are two bytes each. If high-bit, just make a point of stripping the eighth bit and see what they look like. If Unicode, then check for them in your code and substitute the standard quote.

Sorry but your code actually makes me cross-eyed; I can't quite figure out what it actually does, so cannot be more specific, :astonished:

IcyBlade:
is there a way I could add the fancy quotes to the library myself?

I'm pretty sure it is possible, though I have never done it. You can see where the fonts are defined here:

IcyBlade:
I can't change them in the .txt because the .txt is made by another program

I had guessed this was the case from reading your previous thread. That's why I suggested just changing the quotes in the .txt file as a test to be certain this is the cause of the question marks. But Paul__B's idea of verifying the issue by just printing that text directly from an test Arduino sketch is good too. It just all comes down to which is more convenient for you.

Paul__B:
Start by verifying that when you write the quotes into the Arduino program itself, that they do indeed show on the display as quotes.

Then figure out what the spurious characters are - they may either be "high-bit" characters with the eighth bit set, or just possibly Unicode characters which are two bytes each. If high-bit, just make a point of stripping the eighth bit and see what they look like. If Unicode, then check for them in your code and substitute the standard quote.

Sorry but your code actually makes me cross-eyed; I can't quite figure out what it actually does, so cannot be more specific, :astonished:

yeah sorry, I should really work on my formatting because even I get lost reading it. I just like to make things im not currently using into comments so while im testing something else I dont have to delete what I had previously done, I also dont really organize anything unless I absolutely need to until im done and everythings final, then ill go and clean it up. I decided to do what pert suggested and edit the .txt file while the other program was off so it wouldn't mess with it, and it does use those fancy quotes because when I change them out for the regular ones its display on the OLED properly with quotations instead of question marks.

pert:
I'm pretty sure it is possible, though I have never done it. You can see where the fonts are defined here:
Adafruit-GFX-Library/Fonts at master · adafruit/Adafruit-GFX-Library · GitHub
I had guessed this was the case from reading your previous thread. That's why I suggested just changing the quotes in the .txt file as a test to be certain this is the cause of the question marks. But Paul__B's idea of verifying the issue by just printing that text directly from an test Arduino sketch is good too. It just all comes down to which is more convenient for you.

yeah, it does use those fancy quotes because I was able to change them to the regular ones and it displayed properly on the Arduino OLED. I did some digging around through the font files but I really have no idea what im doing in there. im not really sure where I could go from here to figure out how I can fix this, I feel stumped.

IcyBlade:
yeah sorry, I should really work on my formatting because even I get lost reading it.

At least please always do an Auto Format (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor) on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read.

I would also recommend against double spacing your code. Using one or two blank lines in strategic locations to separate the code into logical sections is great, but double spacing only leads to more scrolling for us to read your code.

IcyBlade:
I did some digging around through the font files but I really have no idea what im doing in there. im not really sure where I could go from here to figure out how I can fix this, I feel stumped.

Sorry. I think I mislead you with my previous reply. I had intended to write that I recommend that, instead of messing with the Adafruit_GFX library's fonts, you instead change those characters to regular quotes in either your C# code or in the Arduino code (whichever you are most comfortable working with). Paul__B replied with that same recommendation while I was writing my reply, so I removed the redundant part from my reply, but now I see it makes it look like I was recommending the approach of modifying the Adafruit_GFX library.

pert:
At least please always do an Auto Format (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor) on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read.

I would also recommend against double spacing your code. Using one or two blank lines in strategic locations to separate the code into logical sections is great, but double spacing only leads to more scrolling for us to read your code.
Sorry. I think I mislead you with my previous reply. I had intended to write that I recommend that, instead of messing with the Adafruit_GFX library's fonts, you instead change those characters to regular quotes in either your C# code or in the Arduino code (whichever you are most comfortable working with). Paul__B replied with that same recommendation while I was writing my reply, so I removed the redundant part from my reply, but now I see it makes it look like I was recommending the approach of modifying the Adafruit_GFX library.

oh, I didn't even know that existed! thanks, I'll start using that from now on!

ahh, yeah I understand what you meant now. I feel like it would be easier for me to do it in C#, I looked up some stuff and found this could I use that to replace the fancy quotations with a normal quotation before it gets sent to the Arduino? Like they show an example of using it to correct the misspelled words, could I just use the same kind of method to replace just the quotations?