Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: wchar_t*, char* and perl XS

by xiaoyafeng (Chaplain)
on Jul 14, 2012 at 03:34 UTC ( #981755=note: print w/ replies, xml ) Need Help??


in reply to Re^3: wchar_t*, char* and perl XS
in thread wchar_t*, char* and perl XS

Thanks bulk88!!

Your reply makes me clean up! VS GUI default set code to UNICODE(wide char), but gcc or cl.exe won't. So to me, choice 1 is the best, coz it keeps embeding perl(ANSI) and C CODE consistent.

BTW. for choice 4, personally, I think it's a standard solution of converting wide chars to perl. why nobody modify it a little to suit for importing to perlAPI other than just stay in win32.xs?





I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction


Comment on Re^4: wchar_t*, char* and perl XS
Re^5: wchar_t*, char* and perl XS
by bulk88 (Priest) on Jul 14, 2012 at 14:05 UTC
    BTW. for choice 4, personally, I think it's a standard solution of converting wide chars to perl. why nobody modify it a little to suit for importing to perlAPI other than just stay in win32.xs?

    I have wondered that also. It should be part of Perl's Win32 Perl Standard Library in the perl interpreter, with a win32_ prefix since utf16 is so popular on Windows. You would have to bring up the problem with Perl5Porters and file a bug about there being no standard way in XS to turn a UTF16 string into a Perl Scalar.

    Here is a dump of Perl's win32 specific functions that exported from DLL from Perl 5.17, none of them are public api AFAIK, but some of them are just wrappers around C standard Library I think (On Windows a process can have many different C Standard Libraries loaded because each DLL was compiled with a different Visual Studio, you can not mix resources between different CRTs).
    // win32_abort; Index 1091; // win32_accept; Index 1092; // win32_access; Index 1093; // win32_alarm; Index 1094; // win32_ansipath; Index 1095; // win32_async_check; Index 1096; // win32_bind; Index 1097; // win32_calloc; Index 1098; // win32_chdir; Index 1099; // win32_chmod; Index 1100; // win32_chsize; Index 1101; // win32_clearenv; Index 1102; // win32_clearerr; Index 1103; // win32_close; Index 1104; // win32_closedir; Index 1105; // win32_closesocket; Index 1106; // win32_connect; Index 1107; // win32_crypt; Index 1108; // win32_dup; Index 1109; // win32_dup2; Index 1110; // win32_dynaload; Index 1111; // win32_endhostent; Index 1112; // win32_endnetent; Index 1113; // win32_endprotoent; Index 1114; // win32_endservent; Index 1115; // win32_environ; Index 1116; // win32_eof; Index 1117; // win32_errno; Index 1118; // win32_execv; Index 1119; // win32_execvp; Index 1120; // win32_fclose; Index 1121; // win32_fcloseall; Index 1122; // win32_fdopen; Index 1123; // win32_feof; Index 1124; // win32_ferror; Index 1125; // win32_fflush; Index 1126; // win32_fgetc; Index 1127; // win32_fgetpos; Index 1128; // win32_fgets; Index 1129; // win32_fileno; Index 1130; // win32_flock; Index 1131; // win32_flushall; Index 1132; // win32_fopen; Index 1133; // win32_fprintf; Index 1134; // win32_fputc; Index 1135; // win32_fputs; Index 1136; // win32_fread; Index 1137; // win32_free; Index 1138; // win32_free_childdir; Index 1139; // win32_free_childenv; Index 1140; // win32_freopen; Index 1141; // win32_fseek; Index 1142; // win32_fsetpos; Index 1143; // win32_fstat; Index 1144; // win32_ftell; Index 1145; // win32_fwrite; Index 1146; // win32_get_childdir; Index 1147; // win32_get_childenv; Index 1148; // win32_get_osfhandle; Index 1149; // win32_getc; Index 1150; // win32_getchar; Index 1151; // win32_getenv; Index 1152; // win32_gethostbyaddr; Index 1153; // win32_gethostbyname; Index 1154; // win32_gethostname; Index 1155; // win32_getnetbyaddr; Index 1156; // win32_getnetbyname; Index 1157; // win32_getnetent; Index 1158; // win32_getpeername; Index 1159; // win32_getpid; Index 1160; // win32_getprotobyname; Index 1161; // win32_getprotobynumber; Index 1162; // win32_getprotoent; Index 1163; // win32_gets; Index 1164; // win32_getservbyname; Index 1165; // win32_getservbyport; Index 1166; // win32_getservent; Index 1167; // win32_getsockname; Index 1168; // win32_getsockopt; Index 1169; // win32_gettimeofday; Index 1170; // win32_htonl; Index 1171; // win32_htons; Index 1172; // win32_inet_addr; Index 1173; // win32_inet_ntoa; Index 1174; // win32_ioctl; Index 1175; // win32_ioctlsocket; Index 1176; // win32_isatty; Index 1177; // win32_kill; Index 1178; // win32_link; Index 1179; // win32_listen; Index 1180; // win32_longpath; Index 1181; // win32_lseek; Index 1182; // win32_malloc; Index 1183; // win32_mkdir; Index 1184; // win32_ntohl; Index 1185; // win32_ntohs; Index 1186; // win32_open; Index 1187; // win32_open_osfhandle; Index 1188; // win32_opendir; Index 1189; // win32_os_id; Index 1190; // win32_pclose; Index 1191; // win32_perror; Index 1192; // win32_pipe; Index 1193; // win32_popen; Index 1194; // win32_printf; Index 1195; // win32_putc; Index 1196; // win32_putchar; Index 1197; // win32_putenv; Index 1198; // win32_puts; Index 1199; // win32_read; Index 1200; // win32_readdir; Index 1201; // win32_realloc; Index 1202; // win32_recv; Index 1203; // win32_recvfrom; Index 1204; // win32_rename; Index 1205; // win32_rewind; Index 1206; // win32_rewinddir; Index 1207; // win32_rmdir; Index 1208; // win32_seekdir; Index 1209; // win32_select; Index 1210; // win32_send; Index 1211; // win32_sendto; Index 1212; // win32_setbuf; Index 1213; // win32_sethostent; Index 1214; // win32_setmode; Index 1215; // win32_setnetent; Index 1216; // win32_setprotoent; Index 1217; // win32_setservent; Index 1218; // win32_setsockopt; Index 1219; // win32_setvbuf; Index 1220; // win32_shutdown; Index 1221; // win32_sleep; Index 1222; // win32_socket; Index 1223; // win32_spawnvp; Index 1224; // win32_stat; Index 1225; // win32_stderr; Index 1226; // win32_stdin; Index 1227; // win32_stdout; Index 1228; // win32_str_os_error; Index 1229; // win32_strerror; Index 1230; // win32_tell; Index 1231; // win32_telldir; Index 1232; // win32_times; Index 1233; // win32_tmpfile; Index 1234; // win32_uname; Index 1235; // win32_ungetc; Index 1236; // win32_unlink; Index 1237; // win32_utime; Index 1238; // win32_vfprintf; Index 1239; // win32_vprintf; Index 1240; // win32_wait; Index 1241; // win32_waitpid; Index 1242; // win32_write; Index 1243;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://981755]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-07-29 03:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls