× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



hi Jeff,

Forgive me, but... if you're opening the file in Notepad and then doing a SAVE AS, then the question isn't really about your program, is it? It's about what Notepad chooses to write the file under.

Notepad has absolutely no notion of CCSIDs. Windows isn't nearly as advanced as IBM i when it comes to text encodings. It tries to "guess" the encoding based on the data, and many text documents in the USA, there's no difference at the binary level between UTF-8 and Latin-1

You could probably force Notepad to consider everything to be UTF-8 by writing a BOM at the start of the document.


On 6/22/2012 8:35 AM, Jeff Young wrote:
All,
I have a program that creates files on the IFS that should be UTF-8
coding.
The first file that gets created is in the proper format, but all files
after that are in ANSI.
When I look at the properties under WRKLNK, all files are Coded character
set ID . . . . . . . . : 1208.
When I open the file under Notepad and choose Save As, the first file shows
UTF-8, but all others show ANSI.
Before I call the program to create the file, I used the DEL command to
remove it if it already exists.

<snip>
Bld_File_Name = %Trim(File_Name);
IFS_File_Name = '/excel/xml/' + %Trim(Bld_File_Name) + '.XML';

FileDs = Open(%Trim(IFS_File_Name) // Path & File Nmae
: O_CREAT + // Create File
O_WRONLY + // Write Only
O_CCSID + // Use Code Page
O_TEXTDATA + // Text Data
O_TEXT_CREAT + // Create File
O_INHERITMODE // Inherit Mode
: 0 // Inherit Authority
: CP_UTF8 // PC CCSID
: 0 // Text Create CCSID
);
</snip>

I am using the latest version of Scotts IFS_IO copybook.


Why are all files not in UTF-8 format?

Thanks,




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.