need_uconvert(3alleg4) Allegro manual need_uconvert(3alleg4)NAME
need_uconvert - Tells if a string requires encoding conversion. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
int need_uconvert(const char *s, int type, int newtype);
DESCRIPTION
Given a pointer to a string (`s'), a description of the type of the string (`type'), and the type that you would like this string to be
converted into (`newtype'), this function tells you whether any conversion is required. No conversion will be needed if `type' and `new-
type' are the same, or if one type is ASCII, the other is UTF-8, and the string contains only character values less than 128. As a conve-
nience shortcut, you can pass the value U_CURRENT as either of the type parameters, to represent whatever text encoding format is currently
selected. Example:
if (need_uconvert(text, U_UTF8, U_CURRENT)) {
/* conversion is required */
}
RETURN VALUE
Returns non-zero if any conversion is required or zero otherwise.
SEE ALSO set_uformat(3alleg4), get_uformat(3alleg4), do_uconvert(3alleg4), uconvert(3alleg4)Allegro version 4.4.2 need_uconvert(3alleg4)
Check Out this Related Man Page
uconvert(3alleg4) Allegro manual uconvert(3alleg4)NAME
uconvert - High level string encoding conversion wrapper. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
char *uconvert(const char *s, int type, char *buf, int newtype, int size);
DESCRIPTION
Higher level function running on top of do_uconvert(). This function converts the specified string `s' from `type' to `newtype', storing at
most `size' bytes into the output `buf' (including the terminating null character), but it checks before doing the conversion, and doesn't
bother if the string formats are already the same (either both types are equal, or one is ASCII, the other is UTF-8, and the string con-
tains only 7-bit ASCII characters).
As a convenience, if `buf' is NULL it will convert the string into an internal static buffer and the `size' parameter will be ignored. You
should be wary of using this feature, though, because that buffer will be overwritten the next time this routine is called, so don't expect
the data to persist across any other library calls. The static buffer may hold less than 1024 characters, so you won't be able to convert
large chunks of text. Example:
char *p = uconvert(input_string, U_CURRENT, buffer, U_ASCII, 256);
RETURN VALUE
Returns a pointer to `buf' (or the static buffer if you used NULL) if a conversion was performed. Otherwise returns a copy of `s'. In any
cases, you should use the return value rather than assuming that the string will always be moved to `buf'.
SEE ALSO set_uformat(3alleg4), need_uconvert(3alleg4), uconvert(3alleg4), uconvert_ascii(3alleg4), uconvert_toascii(3alleg4), do_uconvert(3alleg4)Allegro version 4.4.2 uconvert(3alleg4)
Hi,
Please can any one tell me how to convert binary data to text format and vice versa.
If possible give me the algorithm or C program.
Thanks in advance
Waiting for reply
Bye:o (5 Replies)
please let me know that in unix using c programming language we can do binary to string conversion and vice versa using ltoa and atol but how can we do it in c++ programming language.
thank you in advance. (3 Replies)
sscanf() is used in c for inmemory conversion. Is there any routine provided in c++ that allows us to perform the same task(i.e inmemory conversion) as performed by sscanf in c.
I f any one knows plz tell me about it. Thanks. (0 Replies)
Hi all,
It will be very useful If you spare some time with me for this worrying error.
I am calling a conversion program which is written in C++ for converting a file format to different format. It was working fine for this past 2 yrs. But now it is not working since the file size has been... (1 Reply)
Hello all. I need help...
How can I cenvert this 42ec93df826c804ea531c56594db453d54daad4b to normal text? What convertor I have to use?
Thanks. (12 Replies)
Hi all,
I have a requirement to convert a file from one format to another.
Parent file:
to
i.e.,
1.) all the lines which begin with "Sample:", should be converted in such a way that entire text after ":" gets converted into all-lower case.
2.) all the lines which begin with... (7 Replies)
Hi...
Great minds....
I have need of ascii to netcdf conversion,,,,,using C programming...
Can any experts do this task...
here I attached my file....
fill missing value -999 in a grid.. (where there is no data)
first it has read text file (txt)
and then it has to find number... (1 Reply)