× 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.



> I am getting back some information. I want to translate with the
> QDCXLATE api to Ascii, the thing is that in the data sent back by the
> windows server I have some symbols like "Ö", "Ä" (German alphabet), and
> they are wrong translated.

You have to find the correct table for QDCXLATE. You see, there are many
things that can be called "ASCII" and many things that can be called
"EBCDIC."  When you use the QTCPEBC table, you're translating between one
particular version of ASCII and one particular version of EBCDIC.  If
those versions don't happen to match what's actually being sent, then you
end up with mistranslated characters.

Better yet, replace all of your QDCXLATE calls with calls to the iconv()
API.  With iconv() instead of specifying a table name, you specify the
"from" and "to" CCSID numbers.  I've posted samples of iconv() here in the
past, you should be able to find them in the archives.  Here's a link to
one of them:
http://archive.midrange.com/rpg400-l/200403/msg00085.html


> I have tried to compile the program with LANGID(DEU) but doesn´t seem to
> help. Any ideas?

QDCXLATE determines what to translate from & to by using a table (*TBL)
object on disk.  For example, if you want to see what hex codes the
QTCPEBC table translates from & to, you can type WRKTBL QTCPEBC and
select opt 5 to view.

WRKTBL *ALL might help you find the correct table for what you want to do,
but iconv() is much easier, IMHO!

If all else fails, you can create your own table using the CRTTBL command.
The following CL command creates a table called "MYTABLE" and uses the
values in QTCPEBC as the starting values -- but lets you change them:

  CRTTBL TBL(MYTABLE) SRCFILE(*PROMPT) TBLTYPE(*CVT) BASETBL(QTCPEBC)

So, there are lots of options for fixing the problem!  But, in my opinion,
the best option is the iconv() API because you can specify a CCSID, and if
you like, you can store the from/to CCSIDs in a configuration file (or
similar)

This way, if you ever want it to work for something else besides Germany,
all you have to do is change the numbers that iconv() uses...



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.