473,221 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

How to use Split function with Unicode Delimiter

5 Nibble
Hello everyone, i am facing some issue with unique delimiter in visual basic 6. I am trying to create security application which is compatible with Chinese Windows. Although i did many tests today, its still doesn't work. It works only on English Windows.I am pasting the code, and if someone have any idea, i would be grateful for the guidance.
P.s so far, i understood that i need to use ChrW , but as i said, it still doesn't work.
That's not the whole code, just the part that i need to be converted to works on Chinese and other Languages.

The problem are 2 from what i see, the first the split function, how to convert to Unicode, and second does the String must be converted fromUnicode?
on this line - test YO, StrConv(sData(1), vbFromUnicode)

Expand|Select|Wrap|Line Numbers
  1. Sub Main()
  4. Dim YO As String, Datos As String, sData() As String
  6. YO = App.Path & "\" & App.EXEName & ".exe"
  8. Open YO For Binary As #1
  9. Datos = Space(LOF(1))
  10. Get #1, , Datos
  11. Close #1
  13. sData() = Split(Datos, "DELIMITER1")
  15. sData(1) = TEST2(sData(1), "TEST")
  17. test YO, StrConv(sData(1), vbFromUnicode)
  18. End
Jul 19 '22 #1
7 12243
5,501 Expert Mod 4TB
Might be helpful if you could post the UNICODE value of the delimiter that is giving you such problems.
Jul 29 '22 #2
5 Nibble
Expand|Select|Wrap|Line Numbers
  1. sData() = Split(Datos, "ChrW(&H4E00)") 
Jul 29 '22 #3
5,501 Expert Mod 4TB
take the quotes out: sData() = Split(Datos, ChrW(&H4E00))
Jul 29 '22 #4
5 Nibble
Already tried, it does not work.. The problem is not there.
Jul 29 '22 #5
5,501 Expert Mod 4TB
This may not be the "root" issue; however, the double-quotes were absolutely preventing Split() from functioning as expected.
I'm suspecting that there's an incompatibility within/between the different versions of the OS in how they handle the unicode tables

Also... would you try sData() = Split(Datos, ChrW(19968))
I know, the HexValue should work; however, sometimes the conversion goes wonky

Next thing - exactly
How is this not working
What is it returning, if anything, that doesn't match expectations
What error messages, if any, are you getting - please give the exact error number and entire error message (error numbers are often generic with the message providing much more detail).
Jul 29 '22 #6
5 Nibble
About the quotes, when I use quotes, the output file comes out damaged. And the file doesn't work even on English Windows.

When I use quotes, the file is okay, it works on English Windows.

When I moved the file, and try to run on Chinese Windows, I am getting "WerFault" . The file just won't run.

The algorithm that I am trying to develop is for protection against cracking, modification etc. I am using the RC4 encryption algorithm.
I am using builder, where I load the original file, and return it protected with that algorithm. Maybe you're right about the quotes of the second part of the code.
But, when i am trying to remove the quotes in my builder, the file comes out damaged. So to remove quotes maybe is okay on this part of the code shared here, but when I removed it on the builder, the file comes out damaged.

Jul 30 '22 #7
5,501 Expert Mod 4TB
WerFault.exe is a windows error trap module. If you can find the text of the error log in the Windows Event Viewer that would be helpful.

I've a few personal matters to attend to right now; however, with your post of the actual error message we might figure something out

Also, please provide the names of the tools that you are using for your development - might need to use a different IDE, change a setting, etc..
Jul 31 '22 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

by: NewToThis | last post by:
I am trying to use the split function to bread up lines in a file I am reading from. Some lines are working just fine, but a couple of the lines don't split up the way I would have thought. ...
by: Reb | last post by:
Hi, I could split only by a character. How do i split by a string. How can i do something like this. e.g., somestring.Split("name"); Thanks Reb
by: andrewcw | last post by:
The split function takes as a parameter what I understand as array of Char. I can define the delimiter like this: string innerText = new string; char chSplit={'='};...
by: Elhanan | last post by:
hi all.. i have the following string: 200850625~01~464~^^200850625~01~464~^^200850625~01~908~^^ which i will need to turn to a mutli-dimentional string array i used result.Split(new...
by: vivekgrs | last post by:
hi in vb 6.0 ,iam using space in split function. that is working fine. Split(str, " ") now i want 2 use tab. bcoz in the text file the delimiter they are using is tab. so i want 2 use...
by: martinskou | last post by:
Hi, I'm looking for something like: multi_split( 'a:=b+c' , ) returning: whats the python way to achieve this, preferably without regexp? Thanks.
by: grey15 | last post by:
hi to all......am very new to perl....so dnt knw much abt it.... i have a txt file.....so i have to split the values using delimiters.eg have following text- Colombian|The finest Colombian beans,...
by: John | last post by:
Hi I have written a Split function which in turn calls the standard string split function. Code is below; Function Split1(ByVal Expression As String, Optional ByVal Delimiter As String = " ",...
by: handar | last post by:
How do I use Python to split a csv into multiple columns? (using split function using python) "CUSTOMERID","DESCRIPTION","FARE","GUESTS","SEATCLASS","SUCCESS" "1","Braund, Mr. Owen...
by: TylerBennett | last post by:
Currently I am working on a serial number inventory database. When I was testing functionality, I was using the split function with the space as a delimiter, shown below: Dim InputString() As...
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.