NetTalk Central

Author Topic: OT String Theory and UTF8  (Read 2883 times)

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
OT String Theory and UTF8
« on: May 25, 2016, 08:33:04 PM »
Hi All,

I'm trying to convert some data to make the below US ASCII compatible using string theory but the following does not work. Anyone know what I'm doing wrong?


Field" = 'MIDÁSZ PROPERTY MANAGEMENT KFT ARANY JÁNOS UTCA 15'

        st.SetValue(Field")
        If st.ToUnicode(st:EncodeUtf8) = 0
            Message('error convertring to UTF8. Field=' & Field")
        END
        st.RemoveChars('<13,10><13><10>')
        Field" = st.GetValue()

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: OT String Theory and UTF8
« Reply #1 on: May 26, 2016, 04:32:38 AM »
for anyone interested Bruce replied to my email and I was missing the 2nd parameter as shown below.

st.ToUnicode(st:EncodeUtf8,st:CP_WINDOWS_1250)

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: OT String Theory and UTF8
« Reply #2 on: May 26, 2016, 04:36:33 PM »
Update:

st.ToUnicode(st:EncodeUtf8,st:CP_WINDOWS_1250)

didn't actually work but the following does:

st.encoding = st:EncodeAnsi
st.ToUnicode()     

Thanks Kevin Benson for the above!

Aje.elias

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: OT String Theory and UTF8
« Reply #3 on: May 27, 2016, 05:47:30 AM »
Thanks!!
This helped me!!

Alejandro