PROBLEM SOLVED, SEE EDITS 2 AND 3.
so i have several files written in bulgarian that are set up to compile into one PDF however in the process of doing so, several errors popped up despite me compiling the files individually before with no issue whatsoever
first of all, when using \tableofcontents the file wounldn't build and texstudio would return errors like this instead
Command \CYRO unavailable in encoding OT1. ...C {\cyre }\IeC {\cyrm }\IeC {\cyri } }{7}{}
problem is i'm not even using encoding OT1, but T2A and X2.
removing talbeofcontents let the file build successfuly, however that bring us to my second issue
the font on tings like chapters, sections and certain symbols is replaced with this odd font
copying the text and pasting it somewhere else displays the text as saying "chapter 1" even though the text for everything should be in bulgarian
EDIT: upon further inspection, all latin characters seem to be affected, but none in cyrillic
EDIT 2: swapping the places of bulgarian and english in \usepackage corrected the font for the headers, as they display in bulgarian now and not garbled in any way. latin characters characters still appear to be messed- up though
EDIT 3: removing X2 from \usepackage[T2A, X2]{fontenc} fixed the problem with the garbled english font.
the packages i'm using are the following
\usepackage{amsmath,amssymb,latexsym}
\usepackage[T2A, X2]{fontenc}
\usepackage[cp1251]{inputenc}
\usepackage[bulgarian, english]{babel}
\usepackage{mathrsfs}
\usepackage{amsthm}
\usepackage{subcaption}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{epsfig}
\bibliographystyle{plain}
\usepackage[cp1251]{inputenc}
\usepackage[T2A, X2]{fontenc}
\usepackage[english,bulgarian]{babel}

inputenc,fontenc,babel,amsfonts(loaded byamssymb). The order offontencandinputencmay be important; I'm not sure where to check that. – barbara beeton May 09 '22 at 01:00fontencandinputencare old-style method for legacy fonts, not really needed these days, especially with Unicode fonts. Are you able to save the .tex file as utf-8, not cp1251? Code page 1251 is for Cyrillic 8-bit fonts (from before Unicode) and overlaps with latin. Can you use Noto Serif font (withfontspec), for output? (Or some other ttf/otf font with Cyrillic characters). – Cicada May 10 '22 at 07:36fontencandinputenc: https://tex.stackexchange.com/questions/153554/command-maketitle-with-cyrillic-and-times-new-roman – Cicada May 10 '22 at 07:49Error: Command crashed: xelatex.exe -synctex=1 -interaction=nonstopmode "FILE-2022".texi also used xelatex to compile it. – Reddimus May 15 '22 at 18:31