| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >TOANSI (convert expression to ANSI) | [[tied retrieves a value associated with an astring.htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[tounicode.htm|{{btn_next_n.gif|Next page}}]] | | || **TOANSI(string, codepage)** {{blk2blue.jpg|blk2blue.jpg}} | **TOANSI** | Returns a string value converted to ANSI using the encoding of the Codepage parameter | | //string// | A string constant or string expression | | //codepage// | Codepage number used for encoding | The **TOANSI** function returns a string value converted to ANSI using the encoding of the Codepage parameter.  The value of the first parameter can be a Unicode string, an ANSI string, or even a numeric. The second parameter allows for conversions to/from ANSI strings encoded for languages other than the one in use by the OS. As a side effect, the TOANSI function also allows to convert ANSI and Unicode strings to a character sequence encoded in UTF-8 by passing value 65001 as the second parameter. **Return Data Type:    String** example: idname string(40) UTFid   string(40) | CODE | | | idname = 'widget' | | | UTFid = TOANSI(idname, 65001)  ! encoded to UTF8 | **See Also:** [[tounicode.htm|TOUNICODE]]