Click here to Skip to main content
15,313,642 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Testing if Unicode Pin
ThatsAlok27-Jun-10 19:20
MemberThatsAlok27-Jun-10 19:20 
AnswerRe: Testing if Unicode Pin
Richard MacCutchan25-Jun-10 22:12
mveRichard MacCutchan25-Jun-10 22:12 
GeneralRe: Testing if Unicode Pin
Rajesh R Subramanian25-Jun-10 23:38
professionalRajesh R Subramanian25-Jun-10 23:38 
GeneralRe: Testing if Unicode [modified] Pin
Richard MacCutchan26-Jun-10 0:05
mveRichard MacCutchan26-Jun-10 0:05 
AnswerRe: Nothing seems to work Pin
Software_Developer26-Jun-10 2:29
MemberSoftware_Developer26-Jun-10 2:29 
GeneralRe: Nothing seems to work Pin
Richard MacCutchan26-Jun-10 3:35
mveRichard MacCutchan26-Jun-10 3:35 
AnswerRe: Testing if Unicode Pin
Richard MacCutchan26-Jun-10 3:33
mveRichard MacCutchan26-Jun-10 3:33 
GeneralRe: Richards code works. Pin
Software_Developer26-Jun-10 3:57
MemberSoftware_Developer26-Jun-10 3:57 
Thanks Richard.

I ran your code and it works.
Output:
Testing the ASCII string
It is NOT Unicode
Testing the Unicode string
It is Unicode
Press any key to continue



Complete code listing

#define UNICODE
#define _UNICODE
#include <windows.h>
#include <tchar.h>
#include <wchar.h>
#include <stdio.h>
#include <iostream.h>

int main()
{
    char ascii[] = "The rain in Spain";
	WCHAR ucode[] = L"The rain in Spain";

	cout << "Testing the ASCII string" << endl;
	if (IsTextUnicode(ascii, sizeof ascii, NULL))
		cout << "It is Unicode" << endl;
	else
		cout << "It is NOT Unicode" << endl;

	cout << "Testing the Unicode string" << endl;
	if (IsTextUnicode(ucode, sizeof ucode, NULL))
		cout << "It is Unicode" << endl;
	else
		cout << "It is NOT Unicode" << endl;


return 0;

}

GeneralRe: Testing if Unicode Pin
Rajesh R Subramanian26-Jun-10 8:56
professionalRajesh R Subramanian26-Jun-10 8:56 
GeneralRe: Testing if Unicode Pin
Niklas L26-Jun-10 11:44
MemberNiklas L26-Jun-10 11:44 
GeneralRe: Testing if Unicode Pin
Rajesh R Subramanian27-Jun-10 3:30
professionalRajesh R Subramanian27-Jun-10 3:30 
GeneralRe: Testing if Unicode Pin
Niklas L27-Jun-10 9:28
MemberNiklas L27-Jun-10 9:28 
GeneralRe: Testing if Unicode Pin
Hans Dietrich26-Jun-10 12:17
mentorHans Dietrich26-Jun-10 12:17 
GeneralRe: Testing if Unicode Pin
Aescleal26-Jun-10 23:36
MemberAescleal26-Jun-10 23:36 
GeneralRe: Testing if Unicode Pin
Richard MacCutchan27-Jun-10 0:04
mveRichard MacCutchan27-Jun-10 0:04 
GeneralRe: Testing if Unicode Pin
Rajesh R Subramanian27-Jun-10 3:30
professionalRajesh R Subramanian27-Jun-10 3:30 
GeneralRe: Testing if Unicode Pin
Richard MacCutchan27-Jun-10 7:34
mveRichard MacCutchan27-Jun-10 7:34 
AnswerRe: Testing if Unicode Pin
Nemanja Trifunovic27-Jun-10 11:32
MemberNemanja Trifunovic27-Jun-10 11:32 
GeneralRe: Testing if Unicode Pin
VeganFanatic27-Jun-10 18:15
MemberVeganFanatic27-Jun-10 18:15 
QuestionQuestion on CMFCToolBarComboBoxButton -- MDI program. Pin
SAMZCN25-Jun-10 19:33
MemberSAMZCN25-Jun-10 19:33 
AnswerRe: Question on CMFCToolBarComboBoxButton -- MDI program. Pin
Niklas L26-Jun-10 5:25
MemberNiklas L26-Jun-10 5:25 
GeneralRe: Question on CMFCToolBarComboBoxButton -- MDI program. Pin
SAMZCN26-Jun-10 6:24
MemberSAMZCN26-Jun-10 6:24 
GeneralRe: Question on CMFCToolBarComboBoxButton -- MDI program. Pin
Niklas L26-Jun-10 7:27
MemberNiklas L26-Jun-10 7:27 
GeneralRe: Question on CMFCToolBarComboBoxButton -- MDI program. Pin
SAMZCN26-Jun-10 18:47
MemberSAMZCN26-Jun-10 18:47 
Questionhow to register dll or ocx file via c++ code Pin
b-rad31125-Jun-10 10:38
Memberb-rad31125-Jun-10 10:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.