Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
 All Forums
 Other hexagora products
 Programs (Programmi)
 [HELP] Utf7 to UTF16

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert Email Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
sfi_dev Posted - 12 Jun 2012 : 04:14:27
Hello,

I am currently evaluating your product.

I have found that the result when converting a unicode string to utf8 is quite a bit longer than our table columns allow so am looking to see if I can go lower than utf8.

1. I can see that you have a unicode to UTF7 function e.g:
ctlUniRichTextBoxXP1.GetContentsUTF7(ecrtbsc_AnsiText, False)
Is there a way to convert the contents back to UTF16 ?

2. As part of the tool set is there unicode to ansi and vice versa functions to convert text entered in the controls?

Thanks in advance.

Julie

8   L A T E S T    R E P L I E S    (Newest First)
sfi_dev Posted - 15 Jun 2012 : 06:40:50
understand. Thanks Davide :)
s.dav Posted - 14 Jun 2012 : 09:01:36
The ANSI representation of your japanese string is ???? because ANSI cannot contain japanese (extended) characters.
sfi_dev Posted - 13 Jun 2012 : 23:23:28
isnt doing the below converting the unicode japanese string to ansi so it should then display the ansi representation of the japanese characters instead of the ?????
text1.text = StrConv(ctlUniTextBoxXP1.Text, vbFromUnicode)
s.dav Posted - 13 Jun 2012 : 21:08:27
> Is this expected, I thought ansi is the fundamentals of vb controls without using your unicode controls.

Yes, VB6 strings management is Unicode but controls are ANSI so they cannot support unicode so you cannot use Japanese in standard VB6 controls.
sfi_dev Posted - 13 Jun 2012 : 12:04:54
Thanks for the information.

If I have ctlUniTextBoxXP1.Text on screen and type in japanese chars - I then do a basic unicode to ansi convert and display the result in a vb textbox e.g.

text1.text = StrConv(ctlUniTextBoxXP1.Text, vbFromUnicode)

I get ???? marks. Is this expected, I thought ansi is the fundamentals of vb controls without using your unicode controls. Have I got this wrong.

Thanks Davide.
s.dav Posted - 13 Jun 2012 : 09:04:57
The library provides functions for transforming UTF8 strings to Unicode strings (the internal VB6 format) and vice-versa.
You can transform Unicode (UTF16 strings) to ANSI strings/arrays using the internal VB6 function StrConv, so for converting UTF8 to ANSI you need to convert UTF8 to Unicode then to ANSI


'From Unicode string to Ansi Array
Dim aAnsi() As Byte
aAnsi = StrConv(s, vbFromUnicode)

'An Unicode string (as VB6 is unicode for strings) coded in ansi
Dim sAnsi as string
sAnsi = StrConv(s, vbFromUnicode)

'Vice Versa
sUni = StrConv(sAnsi, vbUnicode)

'Unicode string to Array
Dim aUni() As Byte
aUni = s


'Pass VB6 Ansi string to ANSI Windows API
Declare SomeApi (byval sAnsi as string)
SomeApi sAnsi

'Pass VB6 Unicode string to Unicode Windows API
Declare SomeApi (byval lUnicode as long)
SomeApi StrPtr(sUnicode)


so UTF8 to ANSI should be:

dim sAnsi as string
sAnsi = StrConv(oWrap.UTF8toStr(sUTF8), vbFromUnicode)
sfi_dev Posted - 13 Jun 2012 : 00:07:44
Thank-you for the information Davide.

I am now testing with just the plain text box ctlUniTextBoxXP1
To convert from unicode to utf8 I have used -
Dim oWrap As New HexUniControls.clsCommonWrapper
oWrap.StrToUTF8(ctlUniTextBoxXP1.Text)

I have checked through the clsCommonWrapper in VB's object browser and cannot see a utf8 to ansi. Are you able to provide the function name ?

Thank-you

Julie
s.dav Posted - 12 Jun 2012 : 09:27:41
Julie,

the GetContentsUTF7 is a specific function given by Microsoft for the RichEdit control. Unfortunately we actually don't provide a UTF7 to XXX conversion function.

There are conversion function in the CommonWrapper Module for transforming UTF8 data to Unicode or ANSI and viceversa.

Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000