wide char enumeration (wchar_t)

i have been working a cipher for about a year, every now and then... what i need is to be able to point to the case of a wide char so i can do argumentation and stack the file. what is the encode rate on a wide char; as in how many characters are there? i am pretty sure that you have the whole seat for analyzing what your trying to look at. all i have been able to get is an incrementation in the hex but it does not terminate. What about doing it with hex is that what needs to be done. pointing at the character is what im trying to do...
how many characters are there?

In Unicode, there's room from zero to 0x10ffff
Note that if you're using Windows, wchar_t is a 16-bit type and only goes up to 0xffff: many wide characters don't fit in it (but you can use char32_t where supported)

It's a little hard to follow the other questions, do you have code that you're trying to write?
Last edited on
Note that if you're using Windows, wchar_t is a 16-bit type and only goes up to 0xffff: many wide characters don't fit in it (but you can use char32_t where supported)


While it's true that wchar_t is only 16 bit wide on Windows.... in WinAPI it is interpretted as UTF-16, so you can have the full range of U+0000 through U+10FFFF.
here is what i have that drops the hex address range.. if i were to want to work it as hex how would i go about it... check out the code; i don't know why it is its pointing to a hex address... how would you mount a file for hex, because i know you can convert from binary to hex and the other way around. If i where switch case segment hex i could get an argumentative out of it. any examples of mounting a file in hex would be good... where there is sofa lees... i need to plan for hex now because the scope of the variable does not work on windows. so i want to creat a switch case segment with the hex directive, mount the file for hex; then use the index...
how would you declare managing a file with hex? talk more about it after feed back...

marshall

look at the code in compile i might have something...

int main () {
//declare pointer for iteration
wchar_t * case_seg;

//create index var
unsigned int io;
//assign value
io = 1;

wchar_t index[65535];
index[io];
while (io > 0)
{

io++;

case_seg = &index[io];

cout << index << case_seg << "\n";

};



return 0;

}
I don't understand what you're trying to do.

"hex" is just a way to display a numerical value. "16" and "0x10" are both the same number. They have different TEXT because they're being printed differently, but internally the computer represents them the same way.

Characters are the same. A character in C++ is just an integer, but represented differently.

To illustrate:

1
2
3
4
5
if( 'A' == 65 ) // <- this will be true

if( 'A' == 0x41 )  // <- So will this

if( 65 == 0x41 ) // <- as will this. 


They're all the same value. The only difference is how they are represented in text.

So... you do not convert a character to hex. A character is just a different textual representation of the number than a hex printout would be.

So if you want to know the hex code of a character... just assign it to an integer:

1
2
3
4
5
char achar = 'A';
int hexcode = achar;

// #include <iomanip> for the 'hex' cout modifier
cout << "0x" << hex << hexcode;  // prints:  0x41 
Topic archived. No new replies allowed.