473,320 Members | 1,876 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,320 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()
  2.  
  3.  
  4. Dim YO As String, Datos As String, sData() As String
  5.  
  6. YO = App.Path & "\" & App.EXEName & ".exe"
  7.  
  8. Open YO For Binary As #1
  9. Datos = Space(LOF(1))
  10. Get #1, , Datos
  11. Close #1
  12.  
  13. sData() = Split(Datos, "DELIMITER1")
  14.  
  15. sData(1) = TEST2(sData(1), "TEST")
  16.  
  17. test YO, StrConv(sData(1), vbFromUnicode)
  18. End
Jul 19 '22 #1
7 12324
zmbd
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
NewUser13
5 Nibble
Expand|Select|Wrap|Line Numbers
  1. sData() = Split(Datos, "ChrW(&H4E00)") 
Jul 29 '22 #3
zmbd
5,501 Expert Mod 4TB
take the quotes out: sData() = Split(Datos, ChrW(&H4E00))
Jul 29 '22 #4
NewUser13
5 Nibble
Already tried, it does not work.. The problem is not there.
Jul 29 '22 #5
zmbd
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
NewUser13
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
zmbd
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

5
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. ...
3
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
6
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={'='};...
2
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...
4
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...
9
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.
4
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,...
1
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 = " ",...
0
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...
3
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.