Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Название темы: Кирилица в консоли
Показать сообщение отдельно

Ветеран


Сообщения: 1404
Благодарности: 135

Профиль | Отправить PM | Цитировать


Можно использовать WinAPI функцию CharToOem():
Цитата:
CharToOem......Windows 95 Windows NT

Description
CharToOem translates a string from the character set of the current locale to an OEM-defined character set. If a character exists in the OEM character set, the character is used; otherwise, the nearest equivalent is selected.
Syntax
BOOL CharToOem( LPCTSTR lpszSource, LPSTR lpszDest )
Parameters
lpszSource
LPCTSTR: A pointer to a null-terminated string of the current character set.
lpszDest
LPSTR: A pointer to destination buffer to receive the OEM-based string. This buffer may be the same address as lpszSource, in which case the translation is performed in place. This cannot be done if using the wide-character version of this function.
Returns
BOOL: Always returns TRUE.
Include File
winuser.h
See Also
CharToOemBuff, OemToChar
Пример на C:
Код: Выделить весь код
#include <windows.h>
#include <stdio.h>

void main()
{
	char src[10];
	char dest[10];
	strcpy(src,"Привет");
	CharToOem(src,dest);
	printf(dest);
}
или же написать собственную процедуру перекодировки

Отправлено: 12:00, 16-12-2004 | #7

Название темы: Кирилица в консоли