Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include once "windows.bi"
- #include once "crt/stdlib.bi"
- extern "c"
- declare function setlocale (byval as integer, byval as zstring ptr) as zstring ptr
- end extern
- declare function MessageBoxA alias "MessageBoxA" (byval as HWND, byval as LPCSTR, byval as LPCSTR, byval as UINT) as integer
- declare function MessageBoxW alias "MessageBoxW" (byval as HWND, byval as LPCWSTR, byval as LPCWSTR, byval as UINT) as integer
- dim texta as string * 100 = "ハローワールド"
- dim textw as wstring * 100 = ""
- setlocale(0, "jpn")
- 'マルチバイトからワイドに変換
- mbstowcs(@textw, texta, 100)
- MessageBoxA( 0, texta, 0, 0 )
- MessageBoxW( 0, textw, 0, 0 )
- 'ワイドからマルチバイトに変換
- wcstombs(texta, @textw, 100 )
- MessageBoxA( 0, texta, 0, 0 )
- MessageBoxW( 0, textw, 0, 0 )
Advertisement
Add Comment
Please, Sign In to add comment