Your absolutely right I, frencharticle is in another folder so i need to edit my source code so that this file is found from the debug folder.
Nearly there!
Your absolutely right I, frencharticle is in another folder so i need to edit my source code so that this file is found from the debug folder.
Nearly there!
>>so i need to edit my source code
... or copy the frencharticle file to the directory you're running the program from, and leave the source code alone Either way will work.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
Doh! I knew that!
Well I am having a fair amount of success, here is what the bottm end of the table looks like now:
Code:u | 159 v | 32 x | 9 y | 4 z | 1 ŕ | 10 ç | 2 č | 9 é | 97 ę | 2 ď | 1 ô | 2 ű | 1
Now the é is right but the ŕ is wrong, this is supposed to be an à as I have counted 10 of these à 's in my text file. The code page I was using was 1250. The french-canadian code page didnt work at all well. So I think I will now have to be browsing for the correct code page number.
Thanks a lot for your help Hammer.
Yaaaay! After trying 1252, it worked, waaahoooooo!
Ahhh, now I'm going to sleep!Code:s | 268 t | 194 u | 159 v | 32 x | 9 y | 4 z | 1 à | 10 ç | 2 è | 9 é | 97 ê | 2 ï | 1 ô | 2 û | 1
Thanks again Hammer, especially for your patience in dealing with me!
Last edited by CookieMonster; 04-04-2004 at 05:40 PM. Reason: 1250
Are you using Notepad (or something similar) to view the contents of the file yourself?
I seem to remember that Windows can use different code pages for the GUI and the consoles, just to confuse you more. Good luck in your search, here's one I found
http://www.tachyonsoft.com/cpindex.htm
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
It should be noted that the SetConsoleOutputCP() function requires that you are using lucida console or similar as your console font. This is despite the fact that the raster font does support those characters.
Here is a set of functions I wrote that largely bypass the problems with code pages, locales, etc and work with raster or lucida console.
Another option is to use setlocale and wide character output. This also works with raster.Code:/* Requires <windows.h> <stdio.h> */ int PrintStringW(LPCWSTR szOut) { DWORD dwWritten = 0; WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), szOut, lstrlenW(szOut), &dwWritten, NULL); return dwWritten; } int PrintStringA(LPCSTR szOut) { WCHAR buf[BUFSIZ]; LPWSTR szW; int ret = 0; int cchz = lstrlenA(szOut) + 1; if (cchz > 0) { if (cchz > BUFSIZ) szW = malloc(cchz * sizeof(WCHAR)); else szW = buf; if (szW) { if (MultiByteToWideChar(CP_ACP, 0, szOut, cchz, szW, cchz)) ret = PrintStringW(szW); if (cchz > BUFSIZ) free(szW); } } return ret; } int PrintCharW(WCHAR chOut) { WCHAR szOut[2] = { 0 }; szOut[0] = chOut; return PrintStringW(szOut); } int PrintCharA(CHAR chOut) { CHAR szOut[2] = { 0 }; szOut[0] = chOut; return PrintStringA(szOut); } int main(void) { PrintStringA( "x1: éêëì\n"); PrintStringW(L"x2: éêëì\n"); PrintCharA( 'é'); PrintCharW(L'é'); getchar(); return 0; }
Code:int main(void) { /* Requires <locale.h> <wchar.h> <stdio.h> */ setlocale(LC_ALL, ".437"); wprintf(L"1: éê\n"); printf("2: %ls\n", L"éê"); printf("3: %lc\n", L'é'); printf("4: %lc\n", (unsigned char) 'é'); getchar(); return 0; }
Thanks anonytmouse, I've successfully been able to use the second one.
I'm referencing this webpage and usernames in my "sources" section, if that is ok.