Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

OemToAnsi

OEMToAnsi(cStringOEM) -> cRet

Converts OEM/MS-DOS text to ANSI/Windows.

OemToAnsiAdvPL
01 · OVERVIEW

Overview

This conversion supports OEM-origin data displayed as ANSI. It is not generic UTF-8 conversion, trial-and-error accent repair or Unicode normalization. The historical source’s sample already appears encoding-corrupted; this example uses ASCII common to the relevant encodings, without promising the runtime’s code page. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

OEMToAnsi(cStringOEM) -> cRet

Parameters

cStringOEM
CharacterRequired

OEM-encoded text.

Return value

String converted to ANSI according to the runtime.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed561()
    Local cText := "ED01"
    // ASCII does not prove correct accent conversion.
    ConOut(OEMToAnsi(cText))
Return Nil
Expected result

Prints ED01. Accent-byte validation requires known-origin samples. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Identify input/output encoding before converting; avoid double conversion and preserve originals for diagnosis. Do not replace production bytes as a test.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. OemToAnsi. TDN. Accessed on 2026-10-27.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha