473,545 Members | 1,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(ByV al 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_te xt))
c = Asc(Mid$(in_tex t, 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 1123
"Darin" <darin_nospam@n ospameverschrie b:
>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(ByV al 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_te xt))
c = Asc(Mid$(in_tex t, 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@n ospameverschrie b:
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
2363
by: David Eng | last post by:
In replying to P.J. Plauger ( http://groups.google.com/groups?dq=&hl=en&lr=&ie=UTF-8&threadm=1089204435.746211%40master.nyc.kbcfp.com&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26group%3Dcomp.lang.c%252B%252B.moderated ) who responded my post in comp.long.c++ moderated neww group regarding "C++ standard and C++/CLI" topic, I worte the...
7
3018
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: There is * Virtual memory you can allocate (VirtualAlloc) * Global memory you can allocate (GlobalAlloc) * Local memory you can allocate...
22
13651
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 advise. thanks!!
1
1699
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 ..net-frameworks running. What I can read from the _doPostBack the developer edition is testing for Microsoft in the _doPostBack-routine, while...
0
1325
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' In IIS the application is configured to use only windows authentication. The web.config file contains <identity impersonate="true" />. When I...
4
1050
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 UK this morning and... the font's a different size. Someone please tell me fonts aren't different depending on the country? Is there a fix? Bob
17
5040
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 identifying memory leaks. The application in question is the Mozilla Web Browser. I also have had similar tasks before in the compiler construction area....
13
4855
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, suggestions or improvements? if( wmv file) document.write("<OBJECT id=Player classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 height="354"...
3
2482
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 and Chinese. All forms of my compiled C# desktop application, as well as in Visual Studio
4
4296
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" Now i want to use this HANDLE in another thread in another class to
0
7391
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7802
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7746
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5962
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4941
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1869
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1010
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
693
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.