Share this page 

Convert ANSI to Oem character setTag(s): WinAPI/Registry


[Function declarations]
FUNCTION ulong OemToCharA(ref string source_text, ref string dest_text) &
  LIBRARY "user32.DLL"

FUNCTION ulong CharToOemA(ref string source_text, ref string dest_text) &
  LIBRARY "USER32.DLL"

[powerscript]
Integer li_MaxLength
String ls_Source, ls_Dest
Long ll_Ret

ls_Source = "R" + char(130) + "al"  // Ascii OEM for "Réal"
li_MaxLength = 64
ls_Dest = Space(li_MaxLength)
ll_Ret = OemToCharA(ls_Source, ls_Dest)
messagebox("OEM - > ANSI", ls_dest)

ls_Source = "Réal"  
ll_Ret = CharToOemA(ls_Source, ls_Dest)
messagebox("ANSI - > OEM", ls_dest)