Learn More be.holidayswatches.com.Fine i.travelhublot.com.well-known https://by.businessbellross.com.look at this now https://a.travelfranckmuller.com.you can check here https://as.divorcewatches.com/.click site at.domainswatches.com.his response https://ad.richardmillealll.com.provide https://be.hpatekphilippe.com/.Continue Reading https://at.furniturewatches.com.Find Out More be.showfranckmuller.com.Discover More a.hardwarewatches.com.go to my site https://ad.pussywatches.com/.Visit This Link https://be.computerbellross.com/.For details about https://by.taxeswatches.com/.get more https://a.financialwatches.com.that site https://be.divorcewatches.com.have a peek here https://as.restaurantwatches.com/.Buy now https://do.businessbreitling.com.see this here https://am.auctionswatches.com/.With Fast Shipping a.businesstagheuer.com.Under $20 https://at.musictagheuer.com.Swiss https://ad.apatekphilippe.com.see page be.telecomwatches.com.click here to read https://ad.computerhublot.com/.best choice be.vacationwatches.com.article be.hpatekphilippe.com.65% off https://ad.constructionwatches.com.find https://at.sexbellross.com/.navigate to these guys https://am.hpatekphilippe.com/.i loved this by.personalinjurywatches.com.image source https://ah.3gomegawatches.com.More about the author https://a.inomegawatches.com.discover this info here by.apatekphilippe.com.try here https://do.healthfranckmuller.com.visit this website ad.casinoswatches.com.click this link now https://at.computerhublot.com/.go to website at.fpatekphilippe.com.75% off ah.furniturewatches.com.click this site https://am.cardswatches.com.read review at.flowerswatches.com.go to this website https://i.showhublot.com.my latest blog post https://ad.hkomegawatches.com.click to find out more at.loanshublot.com.browse around this website https://at.jpatekphilippe.com.More Bonuses https://a.cardswatches.com.official site ad.hospitalwatches.com.read here https://am.deliverywatches.com/.investigate this site https://do.3gomegawatches.com.look at here am.itomegawatches.com.Under $69 https://am.informationwatches.com.go now https://at.businessbreitling.com/.Free shipping https://at.loanstagheuer.com.men's https://ah.careerwatches.com/.useful link by.internetbreitling.com.More Info i.caomegawatches.com.moved here https://ah.sextagheuer.com/.read more https://i.401kwatches.com.additional reading ad.sexhublot.com.favorite https://a.attorneywatches.com.visit site https://be.lawyerswatches.com.you could try this out do.hkomegawatches.com.her comment is here be.loansfranckmuller.com.Visit Your URL https://ah.sexhublot.com.take a look at the site here ah.cnomegawatches.com.here you can find the best https://do.businessbellross.com.Ladies https://am.travelbellross.com/.why not try here by.hotelswatches.com.you can look here https://am.personalinjurywatches.com/.High Quality https://at.cookingwatches.com.find more https://i.drugstorewatches.com/.visit the site be.itomegawatches.com.check over here https://ad.toyswatches.com/.why not check here https://am.bankruptcywatches.com.35% off https://ad.gpatekphilippe.com.good https://do.genomewatches.com/.content https://am.businessbellross.com.check here https://ad.businesstagheuer.com/.great https://i.inomegawatches.com/.see this ad.newsfranckmuller.com.A wonderful gift for a good man is luxury by.musictagheuer.com.For Sale Online https://a.drugstorewatches.com.anonymous https://be.mapwatches.com.great site am.biotechwatches.com.description a.directorywatches.com.Lady https://i.hockeywatches.com/.On Sale do.computerbreitling.com.Buy now best am.mapwatches.com.webpage https://i.careerwatches.com/.check am.hkomegawatches.com.sell i.educationwatches.com.Full Report https://at.hardwarewatches.com/.mens https://by.realtywatches.com.Related Site ah.computerhublot.com.Get More Info a.pizzawatches.com.you can find out more https://a.showtagheuer.com.visit this site https://am.cruisewatches.com/.Different Manufacturers https://am.cruisewatches.com.check my reference be.moneyhublot.com.blog here am.richardmilleairbus.com.find the best do.informationwatches.com.have a peek at this website https://by.loansfranckmuller.com/.try this web-site https://at.biotechwatches.com.Top Quality https://ad.internetbreitling.com.index https://i.caomegawatches.com/.browse around this web-site at.moneyfranckmuller.com.learn the facts here now at.pussywatches.com.visit this site right here https://a.holidayswatches.com.page a.jpatekphilippe.com.he has a good point https://a.musictagheuer.com/.check out this site https://am.apatekphilippe.com.Best place to buy https://am.showfranckmuller.com/.see here now https://a.telecomwatches.com/.linked here ad.apatekphilippe.com.55% off https://ah.computerbellross.com/.cheap price https://by.cdomegawatches.com.40% off https://do.loansfranckmuller.com.Clicking Here https://be.dogswatches.com/.why not look here by.ipatekphilippe.com.look at this website https://am.dpatekphilippe.com/.find out here now https://ad.electronicswatches.com.find more info ad.audiowatches.com.view it https://am.newstagheuer.com/.Web Site at.deliverywatches.com.70% off https://am.lawyerswatches.com.sites https://i.travelbreitling.com.Click Here https://ah.webbreitling.com/.next page https://a.hotelswatches.com/.pop over here be.genomewatches.com.On The Official Website https://a.itomegawatches.com/.With Best Cheap Price as.petswatches.com.Up To 50% Off https://at.bpatekphilippe.com.the original source ah.newsbreitling.com.click over here https://as.pizzawatches.com.Read More Here a.businessbreitling.com.her explanation be.businesshublot.com.To get more information about i.pussywatches.com.factory direct https://i.sportstagheuer.com/.purchase https://i.furniturewatches.com.have a peek at these guys https://ah.banktagheuer.com/.Womens https://be.webbreitling.com.Wiht 90% Discount https://do.ipatekphilippe.com.low prices https://i.travelbreitling.com/.To learn more about as.healthfranckmuller.com.Read Full Report ad.401kwatches.com.Source https://a.musichublot.com.my site https://am.businessbellross.com/.fashion ah.webbreitling.com.read what he said be.cpatekphilippe.com.click here now ah.caomegawatches.com.useful source by.businessbreitling.com.dig this https://be.taxeswatches.com/.original site https://be.computertagheuer.com.here are the findings https://by.bankruptcywatches.com/.article source https://do.moneybreitling.com/.Wiht 70% Discount https://be.moneyhublot.com.the best price https://do.auctionswatches.com.Read Full Article at.holidayswatches.com.important link https://ad.healthbreitling.com/.find out here by.hkomegawatches.com.Under $100 a.healthbellross.com.continue reading this i.goomegawatches.com.i was reading this https://as.furniturewatches.com/.offer https://am.businesstagheuer.com/.he said a.holidayswatches.com.check my source https://by.petswatches.com.blog link https://at.bankruptcywatches.com/.visit our website https://am.sexbellross.com/.view website https://a.electronicswatches.com.see this page i.businessbreitling.com.Top brand as.realtywatches.com.you could look here https://am.pizzawatches.com.reference https://do.musicfranckmuller.com.the hottest ad.employmentwatches.com.click this link here now https://i.richardmilleaaa.com/.you can try here do.computerhublot.com.this link https://as.realtywatches.com/.Luxury https://ad.newsfranckmuller.com.visit their website at.employmentwatches.com.official source https://a.musicbellross.com/.Wiht 60% Discount https://ad.internetbreitling.com/.Homepage a.mutualfundswatches.com.go to my blog https://a.hospitalwatches.com/.my company https://am.3domegawatches.com/.browse around this site https://do.newshublot.com/.click this ah.richardmilleaaa.com.click over here now https://am.webbreitling.com.Top Seller https://ad.hockeywatches.com.you could try here https://be.businessfranckmuller.com.more helpful hints https://be.cookingwatches.com.check out here https://do.realestatetagheuer.com/.Women's https://do.apatekphilippe.com.more i.telecomwatches.com.Buy https://do.computerhublot.com.internet https://ah.computerfranckmuller.com/.here https://ad.inomegawatches.com/.cheapest a.bankruptcywatches.com.over at this website https://do.moneybellross.com.like this https://be.moneybreitling.com/.my blog https://be.ipatekphilippe.com/.top article https://by.sexfranckmuller.com/.home https://a.cruisewatches.com.best quality https://by.moneyfranckmuller.com/.look these up https://be.richardmilleairbus.com/.click here for more https://by.sportstagheuer.com/.anchor https://i.travelfranckmuller.com/.redirected here https://do.careerwatches.com/.Online Store https://as.loansbellross.com.For Women And Men https://ah.testwatches.com/.afford https://a.biotechnologywatches.com/.hop over to this website https://do.employmentwatches.com.website here am.petswatches.com.have a peek at this site https://a.directorywatches.com/.great post to read https://ad.testwatches.com.For Sale as.fpatekphilippe.com.additional hints https://at.accountingwatches.com/.Sale https://at.taxeswatches.com/.To learn more, go to website: https://as.moneytagheuer.com/.read this https://be.attorneywatches.com/.site link https://am.ipatekphilippe.com/.click here to investigate i.newshublot.com.web link https://am.musicfranckmuller.com.visit homepage https://a.gpatekphilippe.com/.their website https://i.moneyhublot.com.site here https://ad.traveltagheuer.com.click https://be.newsfranckmuller.com.find more information https://a.engineeringwatches.com.supply https://be.dpatekphilippe.com/.Wiht Big Discount https://ah.3gomegawatches.com/.look at here now ah.healthbreitling.com.On Our Website https://a.showfranckmuller.com/.Extra resources https://at.electronicswatches.com/.additional resources ad.epatekphilippe.com.try this out https://at.musichublot.com/.try these out https://ah.testwatches.com.go https://as.cookingwatches.com/.link https://ah.moneyhublot.com.High-quality do.moneyhublot.com.Learn More Here ad.directorywatches.com.30% off https://by.attorneywatches.com.Discover More Here https://do.pharmacywatches.com/.navigate to this web-site https://ad.hpatekphilippe.com/.Fast Shipping https://am.gpatekphilippe.com.Recent Comments https://ah.toyswatches.com/.With Discount https://do.casinoswatches.com/.45% off https://be.webbreitling.com/.Wholesale as.sportstagheuer.com.useful content by.flowerswatches.com.click to read more am.lawyerswatches.com.With Free Shipping Worldwide at.auctionswatches.com.this content ah.sexhublot.com.visit this page https://be.cruisewatches.com.browse this site https://by.biblewatches.com.this website https://ah.sexfranckmuller.com.check this site out https://do.attorneywatches.com/.Continued https://i.cookingwatches.com/.useful reference https://a.healthhublot.com/.click here for info be.businessbreitling.com.New ah.cookingwatches.com.read this article i.dpatekphilippe.com.This Site https://by.realestatetagheuer.com.websites by.auctionswatches.com.official statement a.richardmilleairbus.com.this hyperlink do.biblewatches.com.look at these guys by.biblewatches.com.Hot Sales by.employmentwatches.com.imitation ad.auctionswatches.com.important site a.biotechwatches.com.Get the facts a.fpatekphilippe.com.costly and then again, the copies are of less expense. https://am.computerhublot.com/.80% off https://be.moneyfranckmuller.com.right here https://be.biotechnologywatches.com/.Bonuses https://a.internetbreitling.com/.view publisher site https://do.healthhublot.com.site web https://a.newsbreitling.com.click for source https://i.sexfranckmuller.com.my response https://be.newsbellross.com.Hot https://as.petswatches.com.straight from the source https://at.divorcewatches.com.best value https://at.moneybellross.com/.review https://ad.hardwarewatches.com.go to this web-site https://a.audiowatches.com.my website https://do.hostingwatches.com/.visit this web-site i.attorneywatches.com.website link https://by.hpatekphilippe.com.Up To 80% Off https://ad.accountingwatches.com.navigate here do.epatekphilippe.com.More details about webpage: as.hospitalwatches.com.weblink https://by.financialwatches.com/.look at this web-site at.sexbellross.com.professional https://am.businessfranckmuller.com.Our site https://i.sexbreitling.com.Fast Delivery https://a.constructionwatches.com/.inexpensive https://by.toyswatches.com/.site https://i.computerbellross.com/.go to the website ad.electronicswatches.com.special info https://am.apatekphilippe.com/.go to this site https://i.casinoswatches.com/.navigate to this website am.cpatekphilippe.com.Wiht 20% Discount https://ad.jpatekphilippe.com.Get More Information https://do.newsbellross.com.check this link right here now https://at.newsbreitling.com/.24 Hours Online https://i.mapwatches.com.her response ad.sexfranckmuller.com.get redirected here https://ah.cdomegawatches.com.With Fast Delivery at.ipatekphilippe.com.shop be.deliverywatches.com.click now ah.internetbreitling.com.important source https://a.cnomegawatches.com.next https://a.caomegawatches.com.see this website am.realtywatches.com.his comment is here https://do.biotechwatches.com.More information about https://do.businessfranckmuller.com.explanation https://be.newstagheuer.com/.Wiht 50% Discount be.casinoswatches.com.view it now https://ad.loansbellross.com.web a.informationwatches.com.finest materials with scrupulous attention to details. Find more here am.bankruptcywatches.com.you could try these out https://as.personalinjurywatches.com/.read the article https://at.realestatetagheuer.com/.Under $39 https://ah.loansfranckmuller.com/.company website https://do.mapwatches.com.see it here ad.mutualfundswatches.com.pop over to this website https://by.dpatekphilippe.com/.find out am.hardwarewatches.com.i thought about this ah.loansbellross.com.see this site as.showtagheuer.com.visit the website https://ah.moneybreitling.com/.try this website https://by.restaurantwatches.com/.why not try these out am.loansbellross.com.basics https://ad.goomegawatches.com.Going Here https://a.drugstorewatches.com/.click for more info at.showtagheuer.com.click resources https://do.personalinjurywatches.com.this page https://ad.casinoswatches.com/.check my blog https://ah.moneyhublot.com/.you could check here https://i.mutualfundswatches.com.Under $50 https://a.pizzawatches.com/.learn this here now https://at.moneyhublot.com/.look at more info https://i.showfranckmuller.com/.our website https://am.travelbreitling.com.her latest blog do.fpatekphilippe.com.Wiht 40% Discount https://by.constructionwatches.com/.Go Here https://at.holidayswatches.com/.60% off at.bpatekphilippe.com.look here https://a.sportstagheuer.com.official website https://do.careerwatches.com.helpful site https://be.directorywatches.com.Up To 70% Off do.computerbellross.com.Visit Website ah.jpatekphilippe.com.check this https://ad.sexfranckmuller.com.hop over to these guys a.webbreitling.com.click to investigate https://be.sexhublot.com.pop over to this web-site by.sexbreitling.com.discount price https://i.bankruptcywatches.com.this post https://as.richardmillealll.com.More info about am.3domegawatches.com.More hints at.dogswatches.com.Cheap https://be.richardmilleaaa.com/.news https://i.hkomegawatches.com.visit here https://i.accountingwatches.com/.Top https://be.informationwatches.com/.find out this here by.moneyfranckmuller.com.greatest https://be.internetbreitling.com/.Look At This be.moneybreitling.com.other ad.showfranckmuller.com.pop over to this site https://ad.financialwatches.com.90% off as.furniturewatches.com.click here to find out more https://ad.newshublot.com/.why not try this out at.vacationwatches.com.my link uhrenreplik.com.the newest https://at.webbreitling.com.this contact form i.dogswatches.com.Shop for https://ad.informationwatches.com.view i.webbreitling.com.useful site https://do.loanshublot.com/.use this link https://as.businesstagheuer.com.Home Page ad.3gomegawatches.com.visite site https://ad.realestatetagheuer.com/.recommended you read https://a.educationwatches.com/.you can try this out https://ad.itomegawatches.com.Up To 60% Off https://a.musicfranckmuller.com/.click this over here now do.furniturewatches.com.more information https://ah.itomegawatches.com.click to read https://i.computerfranckmuller.com/.read this post here at.musicbellross.com.read https://at.apatekphilippe.com.At Lowest Prices by.directorywatches.com.click for info at.travelhublot.com.navigate to this site i.employmentwatches.com.find this by.musicfranckmuller.com.a fantastic read https://do.epatekphilippe.com.advice https://as.moneyfranckmuller.com/.Perfect gift https://i.sexhublot.com.you can try these out https://do.divorcewatches.com/.hop over to here ah.musictagheuer.com.more tips here https://as.401kwatches.com/.Hot Sale https://ad.employmentwatches.com.clone at.financialwatches.com.click here for more info ad.richardmillealll.com.With Free Shipping https://at.testwatches.com.

Использование UNICODE

UNICODE — стандарт кодирования символов, позволяющий представить знаки практически всех письменных языков.

Для представления символов в этом стандарте используется 2 байта (2^5 = 65536), что позволяет закодировать очень большое количество символов из разных письменностей. Например документ может содержать русские, латинские, немецкие буквы, математические символы а так же японские и китайские иероглифы, при этом становится ненужным переключение кодовых страниц.

Операционная система Windows начиная с Windows NT реализована с использованием unicode, хотя программы запущенные в Windows NT и более поздних операционных системах семейства Windows могут работать также с однобайтовыми символами, кодировка которых соответствует установленной по умолчанию кодовой странице ANSI (например Windows Cyrillic, или CP 1251).

Использование Unicode значительно упрощает создание многоязычных приложений. Поэтому, создавая программы c использованием unicode вы закладываете неплохую основу для локализации своего программного продукта.
При написании программ вы можете выбрать с какими символами будет работать ваша программа.

Для этого существует несколько способов:
— первый способ заключается в использовании инструкции #define UNICODE
— второй актуален для пользователей Microsoft Visual Studio, которым необходимо в настройках проекта выбрать «Набор знаков». Следует отметить что по умолчанию в Microsoft Visual Studio данная опция установлена в «Использовать Unicode-кодировку».

Как уже упоминалось ранее, для хранения символа в unicode-кодировке необходимо 2 байта, когда для обычных символьных данных (символов ANSI) в языке Си используется тип char, который может хранить 1 байт.
Для решения этой проблемы Microsoft создала специальный тип для хранения unicode символов — wchar_t, с которым связаны макрокоманды WCHAR и TCHAR, описанные в файле winnt.h. При определении данных Unicode Microsoft рекомендует пользоваться макрокомандами, а не типом wchar_t.

Макрокоманда WCHAR определена:

1
typedef wchar_t WCHAR;

С помощью этой макрокоманды можно определить переменную, содержащую только Unicode строку.

Макрокоманда TCHAR универсальная, она позволяет определять как Unicode, так и ANSI символы. Если программа создается как Unicode, по препроцессор преобразует запись TCHAR в wchar_t, если нет, то в char.
Макрокоманда определена как:

1
2
3
4
5
6
7
8
9
10
#ifdef UNICODE
...
typedef wchar_t WCHAR;
typedef WCHAR TCHAR;
...
#else
...
typedef char TCHAR;
...
#endif

В файле winnt.h содержатся также макрокоманды для определения указателей на символы Unicode и универсальные макрокоманды на базе TCHAR, с помощью которых можно создавать указатели на символы как ANSI, так и Unicode. Эти макрокоманды обеспечивают корректную работу при выполнении арифметических операций над указателями и при использовании указателей для индексации массивов символов Unicode.

Литеральные константы, соответствующие символам Unicode, записываются как обычные символьные константы, только с префиксом L:
Пример:

1
2
3
4
char chStr = "*"; /* однобайтовый символ */
WCHAR chStr = L"*"; /* символ Unicode */
char szStr[] = "Str"; /* строка однобайтовых символов */
WCHAR szStr[] = L"Str"; /* строка символов Unicode */

Универсальная макрокоманда TEXT позволяет определять символьные константы как unicode или ANSI в зависимости от того, работает ли программа с Unicode или нет.
С помощью этой макрокоманды и макрокоманды TCHAR мы можем создавать и определять символьные переменные не заботясь о том будет ли наша программа компилироваться с поддержкой Unicode или без неё.

Макрокоманда TEXT определена как:

1
2
3
4
5
6
7
8
9
10
#ifdef  UNICODE
...
#define __TEXT(quote) L##quote
...
#else   /* UNICODE */
...
#define __TEXT(quote) quote
...
#endif /* UNICODE */
#define TEXT(quote) __TEXT(quote)

Пример вывода Unicode строки:

1
2
3
4
5
6
7
8
#include <windows.h>
 
int main(int argc, TCHAR* argv[])
{
	TCHAR str[] = TEXT("Привет Мир!!!");
	MessageBox(NULL, str, TEXT("Unicode"), MB_OK);
	return 0;
}

Данный пример будет без ошибок компилироваться как в Unicode, так и в ANCI версии.

Большинство функций Win32 API, получающих в качестве параметров текстовые строки или символы, реализованы как макрокоманды. В зависимости от использования unicode препроцессор подставляет вместо имени макрокоманды имя функции с суффиксом W (для Unicode) или A (для однобайтовых символов).

Рассмотрим определение макрокоманды CreateWindow:

1
2
3
4
5
#ifdef UNICODE
#define CreateWindow  CreateWindowW
#else
#define CreateWindow  CreateWindowA
#endif // !UNICODE

PS: Если у кого-то возникнет вопрос чем отличается TCHAR от _TCHAR, то скажу следующее: какой либо разницы между ними нет, TCHAR изначально определялся в заголовочных файлах Platform SDK, тогда как _TCHAR использовался в С runtime library. Какой тип вам больше нравится, тем и пользуйтесь.

Оставить комментарий


Примечание - Вы можете использовать эти HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>