File saved to computer as a text file (csv):
We can see the encoding is correctly UTF-8 and the non-ASCII characters (the emojis) are preserved:
The team's machine is assuming a default encoding when opening the CSV in an editor, then on save is replacing non-ASCII characters with ?
placeholders.
Explanation: Emojis are 2 4-bit characters... 2*4 = 8 bits, that's why it's UTF-8, meaning Unicode Text Format 8-bit. It's a newer format, machines will often assume ASCII characters (a-zA-Z0-9!@#$%^&*()_+
, etc.)
Here is the Excel program on my machine defaulting to an ASCII format when opening a CSV:
Since I'm not opening the CSV file in a text editor defaulting to UTF-8 support, the program will have an algorithm to replace sequences of bits it doesn't understand. In the case of emojis, like the smiley face 😀, what the machine sees is actually the tear-jerking sequence of bits as follows: \U0001f604
, which is actually two blocks of sequences (that make up the UTF-8 character). If I were to open the text file in a program that expects UTF-8 characters by default, like Visual Studio Code, it would
Save your key pair downloaded from the EC2 accounts page for the server instance to your local machine.
Save the file in a readily accessible place on your disk. I like saving keys in a directory called keys
in my root.
PEMFILE=/path/to/pem/file.pem
mkdir -p /c/keys
mv $PEMFILE /c/keys
from abc import ABC, abstractmethod | |
import os | |
import sys | |
import time | |
import pandas as pd | |
from helper_functions import ( | |
connectdbmethod, | |
toUtcDay, |
import smtplib | |
from email.mime.text import MIMEText | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.base import MIMEBase | |
from email import encoders | |
email_user = 'your_email' | |
email_password = 'your_password' | |
email_send = 'recipient_email' |
import os | |
import pandas as pd | |
import xlsxwriter | |
from xlsxwriter.utility import xl_col_to_name | |
def set_column(df: 'dataframe', worksheet: 'a pd.Excelwriter sheet', cols: list, format: 'excel format to use', col_width: int = None) -> None: | |
""" sets column by index, the column's position in the dataframe """ | |
idx = [df.columns.get_loc(c) for c in cols if c in df] |
#!/bin/sh | |
#check to see if arguments are set | |
E_BADARGS=65 | |
if [ ! -n "$1" ] | |
then | |
echo "Usage: `basename $0` textfilename [rtffilename optional]" | |
exit $E_BADARGS | |
fi |