#Trouble with displaying polish characters read from file

5 messages · Page 1 of 1 (latest)

spare falcon
#

!sc

vale pivotBOT
# spare falcon !sc
Monke
Please Do Not Send Screenshots!

They're hard to read and prevent copying and pasting.

last bough
#
wchar_t* getLine(FILE* file, int lineNum) {
    //Works
    wchar_t* test = L"ążźćęł";
    wprintf(L"%ls\n", test);



    wchar_t* randLine;
    randLine = (wchar_t*)malloc(sizeof(wchar_t) * BUF_SIZE);
    int count = 0;
    wchar_t line[BUF_SIZE]; 
    while (fgetws(line, sizeof line, file) != NULL) 
    {
        if (count == lineNum)
        {
            //Doesnt work
            wprintf(L"%ls \n", line);
            wcscpy(randLine, line);

            break;
        }
        else if (feof(file)) {
            wprintf(L"Error: Nie znaleziono wylosowanego slowa \n");
            break;
        }
        else
        {
            count++;
        }

    }

    return randLine;
}
vale pivotBOT
#

<@undefined>

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.

last bough
#

!solved