Character encoding conversion programs

I've written a set of these conversion programs. Please give some advices.

Posted On: Saturday 3rd of November 2012 02:19:01 AM Total Views:  803
View Complete with Replies

Related Messages:

Multi-character constants   (237 Views)
After reading through some (open) Intel (CPU detection) C++ source ( I stumbled upon a sketchy use of multibyte characters - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 260: unsigned int VendorID[3] = {0, 0, 0}; try // If CPUID instruction is supported { ... } catch (...) { ... } return ( (VendorID[0] == 'uneG') && (VendorID[1] == 'Ieni') && (VendorID[2] == 'letn') ); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This seems to work, gcc 4.2 emits a warning: "warning: multi-character character constant" and Visual C++ 9 says nothing at all. Whats the matter w/multibyte characters now I didn't use them and would be glad to learn if they are widely implemented and part of the standard soon/now gcc tells us: ( ... [Characters] ... The value of a wide character constant containing more than one multibyte character, or containing a multibyte character or escape sequence not represented in the extended execution character set (C90, C99 ...
printability of extended ASCII characters   (312 Views)
How do you discover if a character including extended ASCII characters are printable By extended ASCII I mean codes above 7Fx0, for example '', 84x0. The following dubious code works on Windows, ( MSVC and g+ + ) but not on Linux. bool is_printable( char c ) { const wint_t unsigned_c( ( c >= 0 ) c : 256 + c ); return iswprint( unsigned_c ) != 0; } I am not actually sure what printable means in this context. What I actually want to know is whether I can write such a character to file and expect it to be redisplayed correctly in a text editor. Extended ASCII characters are displayed in notepad and gedit, but not in a terminal.
list all characters available   (352 Views)
Hi I'm trying to write an app and don't know how to start. I'll have a selector with a list of true type fonts. Each font will represent a different set of chars. Example *arial-font *arabic-font *russian-font *cyrillic-font When the user select one of them, I should list all chars available in the font. With ansi characterset it's easy, just loop from 0-255 and print the char representation of an integer value, but I don't know how to achieve this. Any idea
Unicode character in C++   (241 Views)
Hi all, In my application, I am reading a file and storing it in a array of character. That is ascii in certain situation I get unicode character (or lets say junk character). I want to know that whether it is plain ascii or Unicode...How can I
designing your own characters in C++?   (414 Views)
Is there a way of designing your own characters in C++ (For example some foreign symbols with accents etc...) I am relatively inexperienced in C++, but in other programming languages it used to be possible to design your character on a grid and by using binary for the cordinates program it into the computer and display it alongside "normal" characters. Does such a possibility exist for pure DOS please Cheers, Andy
multibyte characters   (245 Views)
how can I handle multibyte characters like , (german vowel mutation) This does't work: switch(c) case '': ... some action break; case '': ... some action break; .... ....
Is there any STL function for sorting characters inside a string?   (374 Views)
I'm looking for a STL function to sort characters inside a string, like: string_sort("disprove") => "deioprsv".
Unicode to characters   (459 Views)
all, There could be flavors of this question discussed in the past, but I could not really make a head/tail out of it. I have bunch of unicode values stored in a string array and I want to see the corresponding characters displayed in an excel file. How could I go about doing that vector unicodevalues; // has values 0041, 0042, ... 0410 etc. (hexa decimal values) for 0041 (assumes hex) I should see alphabet 'A' , a 'B' for 0042 ... special character corresponding to 0x410. I could live with a comma separated .csv file instead of a .xls to view it in excel. Please advice.
Remove first two characters from char* or from int?   (375 Views)
I have a char *year that contains a 4-digit year (i.e 1929), I use the following syntax c = atoi(year); to convert it to an integer. However I must strip the first two numbers. I've tried to convert it from char* to a string and use the erase function, which works, but then I can't seem to convert the string it to an integer. I am impartial as to when I remove the first two digits, meaning it can be done before or after the conversion to int. In my example above the end result should be an integer variable equalling 29. , yogi_bear_79 wrote: >> c = atoi(year+2); > Perfect!
Newbie Question (take it easy on me fellas) - Creating customASCII-style characters   (304 Views)
Please don't bite me to much with the following post, (a little nibbling doesn't hurt though). When I was a child I owned an Amstrad CPC6128 home computer and liked to fiddle around with the BASIC that came with it. One of my favourite commands was (memory permitting) something like this; DATA xyz$ (1, 1, 1, 1, 0, etc) this allowed you to design your own ASCII-style characters in an 8x8 gird with 1's representing a white dot and 0 not. You could then call this as you would any other single character. I'm currently learning C++ (albeit from a book) and was wondering if there was a similar command for use in console style applications. I hope that you are able to help me with this and don't bite me to much.
get wide character and multibyte character value   (263 Views)
, I need to know the wide character (unicode) and multibyte (UTF-8) values of a character string of czech. I personally know nothing about czech. Is the following approach correct 1. I use L on the character string and watch memory to get the wide character representation of the character string in little endian form; 2. I change the computer region/language to czech, and use function WideCharToMultiByte, and use CP_ACP as input code page and use the L character string as input to get the output multibyte character string output from parameter lpMultiByteStr. Is (1) and (2) correct Any more efficient and smart ways
check and convert lower character to upper character   (309 Views)
How can I check in c++ string if a character is lower or upper Exist a function in c++ to convert string to upper characters
copy unknown number of characters from cstring   (287 Views)
Let's say I have a cstring: char str[] = " world"; and I have a needle: char n[] = "wo"; I find that the needle starts at the 5+1 position of the string. How am I going to copy the characters up to this point, using the header -- Using (c++ string) it is possible in two ways: 1) for (int counter = 0; i < str.find(n); i++) tmp += str[i]; 2) str.substr();
mixing wide- and narrow-character streams   (229 Views)
Compiling with g++ 3.4.5 (Red Hat 3.4.5-2) and running the following program: #include int main() { std::wcerr
Universal-character-names and escape sequences. (in C++0x)   (236 Views)
Given the following code: #include int main() { std::cout
Triming characters off the end of a stream   (246 Views)
I have a strstream, which has a few characters at the end of the stream ')|' to be exact, I want to remove them form the stream, but SetLength doesn't work on strstream, and I can't find any other way to turnicate the stream. - Dan
How can I fix the warning C4786 'identifier' : identifier wastruncated to 'number' characters in the debug information...?   (325 Views)
I have a MyIOManager Object. In this object I have a ""typedef map cmdMap"" I also have a CommandManager & Command Objects. // MyIOManager class .... typedef map commandMap; .... class MyIOManager { .... commandMap cmdMap; CommandManager * cmdManager; Command * cmd .... } MyIOManager::StartIO() { .... cmd = cmdManager->CatchCommand( cmdMap ); .... } // CommandManager class Command * CommandManager::CatchCommand( ... ) { .... // return a Command *... } But I get too many warnings like the following: What is wrong How can I fix it I checked the MSDN Library... there is written that I should shorten the Identifier names..., But I don't understand, I don't have at all long name more than 255 characters...
Adding two character pointer   (429 Views)
How to add two character pointer value Eg: char *a = "10"; char *b = "20"; char *d ; Here i need to add the value of a and b ie., 10 +20 = 30 and have to store it in d. But when i do (d = (int)a + (int)b ) i am getting an error. so please help me how to add a and b value. and store it in d. At last how to print the value of d. Please help me in this issue
accessing the characters of a word   (304 Views)
In the following code, how do I get the program to print out each letter of the word that *delete is pointing to separately I need to access each letter separately. Rather I need to access the last letter of the word. char *delete = "CProgramming"; int i; for(i=0;i
remove characters from a string   (289 Views)
I am a newer, and now i encounter a simple question. i want to erase all specified characters ,such as ',' , from a string. which function should i call for example: string ls( "i ,am, a ,dog,"); thanks in advace --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use ] [ --- Please see the FAQ before posting. --- ] [ FAQ: ]