473,388 Members | 1,207 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,388 software developers and data experts.

different language windows

I have a program that works perfectly when the computer language is
setup for english, but on a spanish computer it doesn't work properly.
Any idea how I can force this routine to only work in english.

Public Function DecryptText(ByVal in_text As String) As String
Dim strKey As String = "1234"
Dim i As Integer
Dim c As Integer
Dim out_buff As String

For i = 1 To Len(RTrim(in_text))
c = Asc(Mid$(in_text, i, 1))
c -= Asc(Mid(strKey, (i Mod Len(strKey)) + 1, 1))
out_buff &= Chr(c And &HFF)
Next
Return RTrim(out_buff)
End Function

Thanks.

Darin

*** Sent via Developersdex http://www.developersdex.com ***
Sep 18 '06 #1
4 1101
"Darin" <darin_nospam@nospameverschrieb:
>I have a program that works perfectly when the computer language is
setup for english, but on a spanish computer it doesn't work properly.
Any idea how I can force this routine to only work in english.

Public Function DecryptText(ByVal in_text As String) As String
Dim strKey As String = "1234"
Dim i As Integer
Dim c As Integer
Dim out_buff As String

For i = 1 To Len(RTrim(in_text))
c = Asc(Mid$(in_text, i, 1))
c -= Asc(Mid(strKey, (i Mod Len(strKey)) + 1, 1))
out_buff &= Chr(c And &HFF)
Next
Return RTrim(out_buff)
End Function
How do the results differ on the two systems?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Sep 18 '06 #2
The characters just differ. It has to do with the unicode setting. I
have seen other english systems where if the language for non-unicode
was something other then english, what is encrypted on a full english
system isn't decrypted. In this case, everything in the regional setting
is set for spanish - mexico.

I just need a method of doing encryption and decryption that is
language-indenpent, but not too easy to crack, and the resulting string
has to have no issues with being stored in an SQL database.

I have looked for some others, but they just store a string of numbers
and I could break it by just looking at it.

Darin

*** Sent via Developersdex http://www.developersdex.com ***
Sep 18 '06 #3
"Darin" <darin_nospam@nospameverschrieb:
The characters just differ. It has to do with the unicode setting. I
have seen other english systems where if the language for non-unicode
was something other then english, what is encrypted on a full english
system isn't decrypted. In this case, everything in the regional setting
is set for spanish - mexico.
Sorry, I missed that you are using 'Asc' and 'Chr' instead of 'AscW' and
'ChrW'. 'Asc'/'Chr' are using the current ANSI codepage which is different
on Spanish and English systems. 'AscW' and 'ChrW' do not have this
"problem".

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Sep 18 '06 #4
didn't know that. I will have to adjust all current encrypted text and
re-do them so Chr is now ChrW.
Thanks.

Darin

*** Sent via Developersdex http://www.developersdex.com ***
Sep 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: David Eng | last post by:
In replying to P.J. Plauger (...
7
by: Office Drone | last post by:
I'm a bit confused about memory usage, and for some reason I wasn't able to find a single point-of-call to get the amount of memory available. If we take, for instance, the Windows platform: ...
22
by: Matt | last post by:
Some people identify Microsoft C# is Proprietary programming language. What is Proprietary programming language then? How does it differ from other languages such as C++, or Java?? Please...
1
by: Frankieboy | last post by:
I believe I've got a postback problem on our site. The strange thing is that everything works fine on my developing version, but not on the production site. I'm wondering if there may be different...
0
by: steven | last post by:
I have an asp.net webapp running on W2K server with .net framework 1.1 The intranet-app supports 2 languages: dutch (fallback language) and french. The choice is made with 'Request.UserLanguages'...
4
by: Bob | last post by:
I thought if I specified Veranda 10 in my application that, if Windows was English language, the font would be the same everywhere. But I just saw a screenshot of my application from a site in the...
17
by: romixnews | last post by:
Hi, I'm facing the problem of analyzing a memory allocation dynamic and object creation dynamics of a very big C++ application with a goal of optimizing its performance and eventually also...
13
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives,...
3
by: Ryan Liu | last post by:
Hi, I have a big urgent problem to solve. I used to use Windows 2000 Chinese version, now I installed Windows XP (English) system. The problem is not about 2000 or XP, it is about English...
4
by: Donos | last post by:
Hi I have a HANDLE to an Event, like this.. HANDLE h = ::CreateEvent(NULL, FALSE, FALSE, NULL); This is running in one thread in one class. For example we will call that class as "Class A"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.