Hi, I use get-content xxx.txt to get the content. It is encoded in utf8,with many multi-byte chars. the problem is: the mult-byte chars are printed as ???? like things. how can i get it work correctly?
Hi, I use get-content xxx.txt to get the content. It is encoded in utf8,with many multi-byte chars. the problem is: the mult-byte chars are printed as ???? like things. how can i get it work correctly?
IIUC, you should use -Encoding parameter with Get-Content cmdlet. -- WBR, Vadims Podans MVP: PowerShell PowerShell blog - www.sysadmins.lv "Andrew" < XXXX@XXXXX.COM > rakstja ziojum
1.Problem with "multibyte or wide character"
2.0xC000005 - Access Violation when trying to save some MultiByte characters to a file by using fwrite
Feel like a dog, I tried everything but couldn't get rid of that error I refer in subject... :-( This part of my code should save the content of editbox to a file (characters need to be saved in multibyte). void SaveInMultiByte(void) { FILE *stream; LPTSTR lpStringInEdit; long int StringLength; char* CharForSave; int numwritten; int a; StringLength = GetWindowTextLength(hWndMainEditBox)+1; lpStringInEdit = (LPTSTR)HeapAlloc(GetProcessHeap(), 0, StringLength +10); MultibyteStringForSave = (char*)malloc(StringLength+10); GetWindowText(hWndMainEditBox, lpStringInEdit, StringLength+10); wcstombs(MultibyteStringForSave, lpStringInEdit, StringLength); if((stream = _wfopen(szFileName, L"wb")) == NULL){ MessageBox(g_hWnd, TEXT("File couldn't be saved."), TEXT("File error"), MB_ICONERROR); fclose(stream); return; } numwritten = fwrite(MultibyteStringForSave, sizeof(char), StringLength - 1, stream); // here I get that access violation fclose(stream); HeapFree(GetProcessHeap(), 0, lpStringInEdit); free(MultibyteStringForSave); return; } What did I make wrong there? The strange thing is that I've been getting that error also with calling the funcs malloc and HeapAlloc approximately 6 hours ago. After when I get rid of that error by calling funcs malloc and HeapAlloc it just starts appearing by calling the func fwrite and I couldn't resolve ths problem out to this moment:-( I will appreciate any tips. Thanks in advance.
3.WinAPI Multibyte/Unicode problem
Hi all, I have a little problem in my application. When I compile it with UNICODE character set, i don't have small icons in my listview items anymore. But if i build it with Multibyte character set, i have theese icons. Someone knows how to correct this? Thanks! Alex
4.Ansi vs Multibyte Name Checking
We have a client requesting that we change our name checking method from the default of Multibyte (UTF8) to Strict RFC (Ansi). Their firewall is rejecting our web page as being Non Compliant. I know how to do this but I am not sure this is something I should do for this client. What are the ramifications if I do this? Is it any kind of security problem the way it is currently, Multibyte? We are having no problems with anyone else in several years so i am hesitant to change for 1 client who might just be Anti MS for some reason. Any Opinions or Ideas?
5.MultiByte strings in the OAL (KERN.EXE)
I am trying to write a REG_SZ registry value in my OALIoCtlHalInitRegistry() function, getting the value from an standard asciiz string passed up from the bootloader. This was what I thought I'd do: MultiByteToWideChar(CP_OEMCP, 0, pBoardInfo->serialNo, -1, Buffer, MAX_PATH); if(Status == ERROR_SUCCESS) Status = NKRegSetValueEx (hKey, VALUE_SERIALNO, 0, REG_SZ, (PBYTE)&Buffer[0], (wcslen(Buffer) + 1) * sizeof(WCHAR)); However this gives me unresolved linker errors, I don't want to include the coredll.dll lib in my OAL, I dont think you can do that can you? So I guess I need a quick and dirty routine to convert an asciiz string to multibyte, any clues anyone?
6. Multibyte (Japanese) shares inaccessible from XP Home
7. IE 6 windows shows characters fuzzy, not clean lined characters
Users browsing this forum: No registered users and 58 guest