Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

the charcter Ñ is translated to Ñ 1

Status
Not open for further replies.

doton

Programmer
Feb 27, 2019
14
0
0
MX
I have text file with the data RUBICEL NUÑEZ GORDILLO
i read the file with
m_data = FGETS(nFileHandle,1000)
messagebox(m_data)
replace nombre with m_data
messagebox(nombre)

why is the data changed to RUBICEL NUÑEZ GORDILLO

 
Codepages.

Same bytes interpreted in different codepages are different characters.

Neither FGETS nor REPLACE do byte value changes. The display in a messsagebox will be by whatever codepage the default VFP IDE codepage.

The file might have another one, or Unicode.

Make sure your transferring this making the necessary transition. It's not easy, as what codepage a file is in isn't available as file property or within the file. But many editors like Notepad++ will infer what codepage a file is in, so open up your source file with notepad++ and find out how the file is encoded.

Then you can use STRCONV() to convert from one to another codepage so the letter gets into your DBF the way it should be taking into account the codepage of VFP. Or you can save the source file with changed codepage, again possible with Notepad++.

Like I said earlier in another thread, have a good editor in your toolbelt.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top