Fog Creek Software
g
Discussion Board




Story about fun with character sets

I was working at a company where the main product was written in Visual FoxPro. The settings data that was stored in the Database was encoded using a simple (and very crackable) encryption scheme. The encryption scheme itself was written to shift the characters around in a specific algorithm. The only problem is that the characters were converted into ASCII before doing the shift.

So along I come and I have to write Webapp using Java/JSP that needs to pull data from the database that is encrypted using this scheme. The key problem with porting the encoding algorithm is since the algorithm works with ascii characters, they are going to wrap at the end if you shift the characters over enough, and so you have to mimic this in a Language where Unicode is the base String implementation. Without getting into the details I figured it out, but it goes to show that you really need to consider your character set even when you are not doing internationalization.

As a little aside, you can imagine my suprize (or lack thereof) when we tried to make the FoxPro Application work with a Unix version of Oracle and non of the encryption work anymore.

Gp
Saturday, October 11, 2003

Languages such as Java and C# should implement 2 types of strings: ASCII strings and Unicode strings.

People speaking other languages should also switch to English, and in time, all the people should speak only English.

I am saying this as a non-native English speaker.

The advantage of having all the people all over the world speaking only one language is far greater than the disadvantages.

JX
Sunday, October 12, 2003

and all those Mac and Linux users should switch to Windows. The advantage of having all the people all over the world using only one operating system is far greater than the disadvantages.

runtime
Sunday, October 12, 2003

Everyone switching to english would be fun.

But do you know how many regional accents and dialects there are in the UK?  Or in the US?

All languages fragment, that is their nature.

i like i
Monday, October 13, 2003

The converse is also true: All languages converge, that is their nature.

English (printed, at least), actually, has converged to a great degree over time. Mostly due to increased efficiencies in publication and migration/relocation.

As there is a "force" for fragmentation, there is also an opposite "force" for convergence and standardization.

njkayaker
Monday, October 13, 2003

*  Recent Topics

*  Fog Creek Home