PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Text file with international characters & symbols how to translate to English US  (Read 922 times)

Sonia Cruz

  • Member
  • **
  • Posts: 12
    • View Profile
Hello all!
Do you know how and when detect special characters contained in rows of a text file coming from international symbols of, for example, addresses of Europe, South America, etc., how to translate / convert them to character code equivalent to the English (United States) language? This is for an electronic file that the format do not accept special characters and symbols.   
Thanks in advance!
Regards
Sonia Cruz

Ken Sproul

  • Gold Member
  • ****
  • Posts: 60
    • View Profile
There are a few ways to tackle this.  Check out the tbl= read option and table directive, the translate directive, and the tbl() function.


Manual links:
https://manual.pvxplus.com/PXPLUS/directives/read.htm
https://manual.pvxplus.com/PXPLUS/directives/table.htm
https://manual.pvxplus.com/PXPLUS/directives/translate.htm
https://manual.pvxplus.com/PXPLUS/functions/tbl.htm
Ken Sproul
DPI Information Service, Inc.
Pivotal Systems LLC

Devon Austen

  • Administrator
  • Diamond Member
  • *****
  • Posts: 382
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
If the international symbols are Unicode (UTF-8,UTF-16) you can pass in the input text through the CVS() function and convert to ASCII. This still allows for some international symbols which are part of ASCII though. If your problem is non ASCII then CVS will work for you.

CVS(inputText$,"UTF8:ASCII")

https://manual.pvxplus.com/?functions/cvsextend.htm 
Principal Software Engineer for PVX Plus Technologies LTD.