Page 1 of 1

Do you know how to use iconv.dll?

Posted: Mon May 07, 2018 8:33 am
by kkwan
I have a question.

convert from ansi characters to UTF8
Converting from UTF8 to ANSI characters
Occasionally, unwanted broken characters stick behind.

example)
ansi-> utf8

   cStr: = AnsiToWide (cStr)
   cStr: = HB_TRANSLATE (cStr, "UTF16LE", "UTF8")

utf8-> ansi
   cStr: = HB_TRANSLATE (cStr, "UTF8", "UTF16LE")
   cStr: = WideToAnsi (cStr)
  
// ----------------------------------------------


So we are using iconv.exe for Windows.
This is cumbersome to open cmd.
Of course, it is automated as a .bat file.

I want to know if iconv.dll is available.
I'd appreciate it if you could tell me how to use it.

Re: Do you know how to use iconv.dll?

Posted: Mon May 07, 2018 9:45 am
by Antonio Linares

Re: Do you know how to use iconv.dll?

Posted: Tue May 08, 2018 5:54 am
by kkwan
Thank you for your quick reply.
View sample and make it available in FWH
I tried coding but it was not what I wanted.
I'm sorry, but if you can support it right away in FWH
Thank you.
If not, I'll just give up.
I think it is not so important.
There are many ways to do this.

Re: Do you know how to use iconv.dll?

Posted: Tue May 08, 2018 8:34 am
by kkwan
ANSI-> UTF8
UTF8-> ANSI

If you convert, you may notice that the undesired
We have resolved the following.
Thank you.

However, I would appreciate it if you support it in iconv.dll FWH.

cStr: = cStr + "#"
CSTR = AnsiToWide (CSTR)
CSTR = HB_TRANSLATE (CSTR "UTF16LE", "UTF8")
nPos: = at ("#", cStr)
Return SubStr (cStr, 1, nPos-1)