String conversion

I would like to ask if there is a way to convert characters that are not 
plain ASCII to ASCII.
For example I would like to make a function that converts

á to a
α to a
γ to g

Is that possible?
Thank you.

Dimitri
0
Dimitri
11/29/2009 8:49:36 AM
vb.general.discussion 1016 articles. 0 followers. Follow

3 Replies
594 Views

Similar Articles

[PageSpeed] 0

Something along

Function conv(dummy As Char)
  Select Case dummy
  Case "=E1", "A" ' and so on
    conv =3D "a"
  Case Chr(247)
    conv =3D "x"
  Case Else
    conv =3D dummy
  End Select
End Function

didnt try it so dont know if it works.
Whats plain ascii... a-z 7-bits US version, got a lot of SOH; EOT, DC1
and so on, thats still ASCII but what do I know..

//CY
0
CY
11/29/2009 11:34:43 AM
"Dimitri Kowaletschew" <dimi.k@yahoo.com> wrote in message 
news:utt1uDNcKHA.2160@TK2MSFTNGP02.phx.gbl...
> I would like to ask if there is a way to convert characters that are not 
> plain ASCII to ASCII.
> For example I would like to make a function that converts
>
> á to a
> α to a
> γ to g
>
> Is that possible?
> Thank you.
>
> Dimitri

To clarify the terminology (for Windows systems):
Standard ASCII is 127 characters.
Extended ASCII is 255 characters.  The additional 128 characters are defined 
according to the "code page" for the users location.
ANSI is Extended ASCII.  Most commonly, "US ANSI" uses the "Western 
European" code page (code page 1252).

If you are intending that your application converts characters only for code 
page 1252, then simple Select/Case coding will be necessary.  There is no 
algorithmic way to do it using Asc() values.  Note that if the application 
is installed in a location with a Language Setting other than code page 
1252, it will not be useful for the extended character set as these differ 
for different code pages.

If you do wish to accommodate other character sets (such as Eastern 
European, Cyrillic, etc.), then you would have to convert such characters to 
Unicode (StrConv) using the Locale parameter to correspond to code page for 
the character.  Then you would make more comprehensive Select/Case code work 
on the Unicode values for the characters.  (Unicode is code page independent 
and has a unique value for each character, irrespective of its language.)

Note that Locale ids are not the same as Code Page ids, for example Locale 
1033 (Default English) uses code page 1252, as does locale 1031 (German).

Consider the Slovenian character "č" for example.  If an ANSI file is 
created in Central Europe (code page 1250) which includes that character, 
then if that file is read on a code page 1252 system (US or Western Europe), 
the character will not appear correctly.  If the file were a Unicode file, 
the character would appear correctly worldwide.  Assuming your locale is the 
US or a Western European country, you can experiment with Notepad to check 
this.  Open Notepad, cut/paste the "č" character from this reply, save as an 
ANSI file, and save again as a Unicode file.  Then reopen each file in 
Notepad; you will see that the character was not correctly saved in the ANSI 
file because the code page for your Locale does not accommodate this 
character.

If you are attempting an all-characters conversion that will work worldwide, 
the logic will be more complex than a simple ANSI conversion within systems 
of a common Locale.

Nigel
 

0
Nigel
11/29/2009 12:20:10 PM
Hello Nigel!

Ah, okay. I just wasn't sure that that this is such an exotic wish that 
it isn't included in the VB6 runtime or else.

Thanks again.
Dimi

Nigel Bufton wrote:
> "Dimitri Kowaletschew" <dimi.k@yahoo.com> wrote in message 
> news:utt1uDNcKHA.2160@TK2MSFTNGP02.phx.gbl...
>> I would like to ask if there is a way to convert characters that are 
>> not plain ASCII to ASCII.
>> For example I would like to make a function that converts
>>
>> á to a
>> α to a
>> γ to g
>>
>> Is that possible?
>> Thank you.
>>
>> Dimitri
> 
> To clarify the terminology (for Windows systems):
> Standard ASCII is 127 characters.
> Extended ASCII is 255 characters.  The additional 128 characters are 
> defined according to the "code page" for the users location.
> ANSI is Extended ASCII.  Most commonly, "US ANSI" uses the "Western 
> European" code page (code page 1252).
> 
> If you are intending that your application converts characters only for 
> code page 1252, then simple Select/Case coding will be necessary.  There 
> is no algorithmic way to do it using Asc() values.  Note that if the 
> application is installed in a location with a Language Setting other 
> than code page 1252, it will not be useful for the extended character 
> set as these differ for different code pages.
> 
> If you do wish to accommodate other character sets (such as Eastern 
> European, Cyrillic, etc.), then you would have to convert such 
> characters to Unicode (StrConv) using the Locale parameter to correspond 
> to code page for the character.  Then you would make more comprehensive 
> Select/Case code work on the Unicode values for the characters.  
> (Unicode is code page independent and has a unique value for each 
> character, irrespective of its language.)
> 
> Note that Locale ids are not the same as Code Page ids, for example 
> Locale 1033 (Default English) uses code page 1252, as does locale 1031 
> (German).
> 
> Consider the Slovenian character "č" for example.  If an ANSI file is 
> created in Central Europe (code page 1250) which includes that 
> character, then if that file is read on a code page 1252 system (US or 
> Western Europe), the character will not appear correctly.  If the file 
> were a Unicode file, the character would appear correctly worldwide.  
> Assuming your locale is the US or a Western European country, you can 
> experiment with Notepad to check this.  Open Notepad, cut/paste the "č" 
> character from this reply, save as an ANSI file, and save again as a 
> Unicode file.  Then reopen each file in Notepad; you will see that the 
> character was not correctly saved in the ANSI file because the code page 
> for your Locale does not accommodate this character.
> 
> If you are attempting an all-characters conversion that will work 
> worldwide, the logic will be more complex than a simple ANSI conversion 
> within systems of a common Locale.
> 
> Nigel
> 
> 
0
Dimitri
11/29/2009 4:15:14 PM
Reply:

Similar Artilces:

Goldmine Conversion of Activities V 1.2
We are trying to convert the Goldmine Activities into CRM Activities. It does not appear to allow you to modify any Activity Forms. You can modify most other forms. Is there any way to modify the Activity Forms? We need to add in a couple of fields on some, and add some items to the Direction Picklists. Thanks! Modifying the actual forms for activities is not supported in the current release. Matt Parks MVP - Microsoft CRM ---------------------------------------- ---------------------------------------- On Tue, 8 Feb 2005 14:01:02 -0800, "Shauna Koppang" <ShaunaKoppang@d...

Search a string in all worksheets ?
I am searching for a string say ABC in all worksheets in Excel 97. However, it seems that it only allows me to search it in the current worksheet. Is there any suggestion ? Hi Peter............ In XL2k, I just highlighted all three sheets using Right-click on one tab and choosing Select all sheets..........then did Edit > Find > and typed my search string in the window and hit "Find next" repeatedly and it cycled through all three sheets finding the string...........is that what you're wanting to do? Vaya con Dios, Chuck, CABGx3 "Peter" <anonymous@di...

XmlTextReader to a xml string
I want to use FOR XML in my query so I'm going to use the ExecuteXmlReader method? The trouble I'm having now is streaming the results to a string for output as an XML document. Also, since the XML that comes from teh query is not a complete document it's a fragment without a root element. So, any ideas about how to get his into a string? --Buddy Buddy Ackerman wrote: > I want to use FOR XML in my query so I'm going to use the ExecuteXmlReader > method? The trouble I'm having now is streaming the results to a string for > output as an XML document. Also, ...

How can you copy selected cells when one cell contains a specified string?
Hi! I need to paste selected cells into different worksheets. The cells contain information like: date, amount, category eg: 24/08/04, 590, eggs 25/08/04, 430, cheese what I wanna do is copy date and amounts to eggs worksheet or cheese worksheet, depending on whether category is eggs or cheese. Is there a way to combine the IF function with a paste link, or something like that? Thanks a bundle in advance! Jon. Formulas return a value to the cells in which they reside. They cannot perform actions, such as copy,paste ect. what you want is possible but you didn't not provide enou...

How do I write a string in the destination element depending on what the string is in the source, using XSLT/XPath? (Like a switch statement.)
Is there something like a switch statement in XPath? What I want to do is this: In the source there is an element called "member" with either the value "0" or "1". In the destination element (also called "member") the value should be "No" or "Yes" (Where "0" corresponds to "No" and "1" to "Yes"). How do I do this? Joakim Olesen wrote: > Is there something like a switch statement in XPath? What I want to do is > this: > > In the source there is an element called "member&quo...

Vanguard Mutual Fund conversion to Admiral Shares
Vanguard occasionally converts a mutual fund to an Admiral share when the accumulated value exceeds $100,000. How should this be handled in Money 2006? For example, if I own X shares of VFINX with a market value of 100,000 and a basis of 50,000, and then Vanguard converts all X shares to the Admiral equivalent VFIAX, how should I reflect that in Money and retain my basis? Do I Add Shares, Buy, Transfer In, etc.? Similarly, how should I deal with the VFINX that went away - a Remove Shares, Transfer Out, Sell (strongly doubt), etc.? Thanks! In microsoft.public.money, George wrote: &g...

How to find a text in a string without giving the position of the
My requirement are I want to find a particular text in a string with out giving the position of the text . I believe that if we use find and search we have to give the text position for the particular text. Can anyone guide me what should be the function used for getting this. Post example(s) -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett@gmail.com "Sreekanth" <Sreekanth@discussions.microsoft.com> wrote in message news:B2ABF7FC-5745-4863-AA05-4EC1D61C825E@microsoft.com... > My requirement are > I want to find a particular text in...

Stringing formulas again
Hey there Roger, once again this formula thing is driving me crazy...I can visualize what I want to do but can't work out the formula...This is how I see it in my mind =IF(AI13,AW13,BI13,BW13,CJ13="N","",IF(AI13,AW13,BI13,BW13,CJ13="R","",SUM(AI13+AW13+BI13+BW13+CJ13/100)))) What do you think? Cheers David Perhaps this will help........... =IF(OR(AI13="N",AW13="N",BI13="N",BW13="N",CJ13="N",AI13="R",AW13="R",BI13="R",BW13="R",CJ13="R"),""...

Conversion from Quicken 4.0
I am having difficulty in converting my old Quicken 4.0 data into Money. The Money version I'm using is 14.0.100.1105. According to the help file, Money should convert from Quicken 3.0 and up. When I use the 'Convert Quicken File' option from the File menu, it just says the file could not be converted. I would NOT like to do the conversion account-by-account through QIF files, more so because all the income/expense categories I've set up would be lost. Any help would be most appreciated. Regards, Shubho Which version is Quicken 4? If it's Quicken 98, then see http:...

String of strings
Is there a standard way of handling a double null terminated string with embedded null terminated strings. I've looked but can't find any examples. TIA, Gerry Murphy You have to manully put them in string, I believe you are looking for MutliSz reg string or string for shFileOperation if i am not wrong. -- With Regards Alok Gupta Visit me at http://alok.bizhat.com "I Believe this will Help" "Gerry Murphy" <gerrymurphy@rcn.com> wrote in message news:YNydnaPkJaUXCc7fRVn-uQ@rcn.net... > Is there a standard way of handling a...

Count occurance of a string across numerous worksheets
Hi all, Have a "Control Page" and numerous other sheets. I've now listed all workseets on the "Control Page" eg: .. A B 10 Feb04-Mar04 11 Jan04-Feb04 12 Dec03-Jan04 13 Nov03-Dec03 14 Oct03-Nov03 15 Sep03-Oct03 16 Aug03-Sep03 17 Jul03-Aug03 18 Jun03-Jul03 19 May03-Jun03 20 Apr03-May03 21 Mar03-Apr03 22 Feb03-Mar03 23 Jan03-Feb03 24 Dec02-Jan03 25 Nov02-Dec02 Im trying to count the number of times a specific string "Internet Usage - Prepaid IP Hours &q...

Searching for Substrings Within Strings
I would like to be able to search and flag a list of string data based on another list of substring data. If I have a list of strings in Column A and input the list of substrings in Column C, I would like an "X" to appear in Column B every time that a substring mentioned in Column C is included in any of the strings indicated in Column A. (There cannot be multiple instances of the same substring, or a combination of different substrings, in each string of data in Column A.) For instance, given the following information indicated in Columns A and C, the "X" should appear a...

Cheque printout to a file with date & amount converted to text/string
Print cheque output a text file, and this text file will be sent to bank for further processing. There are some fields are hardcoded and some are from GP fields, including date and amount. We modify the Report Writer for the Cheque printing, the added a few of calculated fields. Some calculated fields will contain text with hardcoded data (may contain special characters, like comma and /) Some calculated fields will hold data from the field found in GP and if it is date format, it will be using RW_DateToString() to convert it to string text and this calculated can be showing in...

Syntax Error in a SQL string
Can someone spot the syntax error in this SQL string? I tried, but could not see where it is. Thanks in advance, Paulo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Set qdfTemp = CurrentDb.CreateQueryDef("Current Orders Set", _ "SELECT IIf([Orders]![Status]='REC',[Orders]![DC Cims Week Actual],[Orders]![ETA to DC Cims Week]) " & _ "AS RelevantWeek, Sum(Orders.[Order Qty]) AS [SumOfOrder Qty], Sum(Orders.[Received Qty]) AS [SumOfReceived Qty], " & _ "Sum(IIf([Orders]![Channel]='WHOLESALE',IIf(...

How do I remove * from text string in cell
I need to remove the asterisk character from a text string within Excel but ordinary find/replace just sees it as a wildcard and deletes everything. Hi Search for ~* and it should work. HTH. best wishes Harald "Sue" <Sue@discussions.microsoft.com> skrev i melding news:15AB8A9C-4C55-4653-94DE-3D2DC2C2BEA8@microsoft.com... > I need to remove the asterisk character from a text string within Excel but > ordinary find/replace just sees it as a wildcard and deletes everything. ...

RecordsetClone SQL string
I am trying to retrieve the RecordsetClone SQL string form a filtered form. I just can't get a handle on how to do this. Thanks "DataCorp" <kurt @at dataman.cc> wrote in news:Z-WdnQGjTO2On_nanZ2dnUVZ_v-hnZ2d@bresnan.com: > I am trying to retrieve the RecordsetClone SQL string form a > filtered form. > > I just can't get a handle on how to do this. > > Thanks > That's because there is no handle. use the form's recordsource property to determine the name of the query, then go through the querydefs collection to retrieve the SQL. ...

Inserting Variables in String
I don't even know if I am using the proper terminolgy but here goes. I have three columns of variables that I would like to insert in a URL at specific points. I will try to describe what I am trying to do here in the following example: Cell A1 62.987 Cell B1 94.256 Cell C1 Alfrey Cell D1 http://www.mydomain.com/abcdVarA1efghVarB1hijkVarC1lmn.htm The above shows only Row 1 of many rows. I would like to insert the contents of A1 into the URL taking the place of "VarA", insert the contents of cell B1 into the section that says "VarB" and the contents ...

XmlSerializer and multi line strings
Hello, can somebody tell me how to serialize/deserialize a object containing a multi line string using the XmlSerializer class. One of the both windows linefeed chars get dumped somewhere down the road. It would be awesome somebody could answer this, sadly most of my questions don't get answered. Regards, Frank "stax" <agfagfagfaf@fdghsgsgs.de> wrote in message news:d60um1$lsj$1@online.de... > One of the both windows linefeed chars get > dumped somewhere down the road. Look at the XML at each point down the road to figure out where the problem lies. > can som...

Converting from string to integer, integer to string, string to float, float to string
Hi All, How can I perform these conversion functions? I use Visual C++ 6.0 and I want to use available libraries, not to go downloading some other ones from the web and not to do some myself. I found myself StrToInt and StrToInt64Ex. How about the other ones? Regards, Nicolae On Mon, 1 Nov 2004 01:21:05 +1100, "Nicolae Fieraru" <nospam@please.com> wrote: >Hi All, > >How can I perform these conversion functions? I use Visual C++ 6.0 and I >want to use available libraries, not to go downloading some other ones from >the web and not to do some myself. &g...

E-Mail Conversion
I've been using Microsoft Office Outlook 2007 Trial on Windows Vista, but I am now going to be going back to XP more often. (Although I'm not getting rid of Vista nor the Office on there yet.) On XP, I have Microsoft Office XP Professional. My problem is, I'm wanting to import all of my e-mails I had in Outlook 2007 into Outlook 2002, but it won't import them. Also, if I try to open an e-mail, I get a message saying that the e-mail requires Office 2003 or newer to open them. How can I get the message converted back into something Outlook 2002 will read? Actually, i...

Euro Conversion #2
I get this speadsheet once a month from one of my retailers. There are usually 300 products with 300 different prices all in Euro. Is there an easy way to convert all this to US Dollars from Euro in the spreadsheet? ...

Error Sorting Strings
I'm trying to sort the below table by numbers first, then string-only records. The numeric records will come first, a double digit "10" sorts before a single digit "4", etc. I've tried several suggested methods but I'm getting a string conversion error. Can someone take a look at this DDL and explain how can I test each string to see if it begins with a number and then sort as I described? The error is "Error converting data type varchar to numeric." DDL ================ IF object_id('tempdb..#tmpMyTable') IS NOT NULL B...

How do I get a string from the string table?
Is there a routine to get a string from the string table, where you give it the ID and it returns a char* or CString? Chris Baker wrote: > Is there a routine to get a string from the string table, > where you give it the ID and it returns a char* or CString? CString sText; sText.LoadString( IDS_HELLOWORLD ); Simon "Chris Baker" <ChrisBaker@discussions.microsoft.com> wrote in message news:<3068961C-0752-4983-8274-6C43128C5006@microsoft.com>... > Is there a routine to get a string from the string table, > where you give it the ID and it returns a char* or...

Converting STRINGS into FORMULAS
really needing this... let's say A1 = "SUM" B1 = "(" C1 = ")" D1 = "A3:C8" How can I put everything together and get the FORMULA =SUM(A3:C8) and its result INSTEAD of the STRING "=SUM(A3:C8)"? it's drivinhg me mad....I've tried CONCATENATE, &,... and all I get is the string... Thanks a lot Dario - Brazil Why? Would this satisfy your need? =SUM(INDIRECT(D4)) -- Don Guillett SalesAid Software donaldb@281.com "Dario Jardim Junior" <dario.jr@uol.com.br> wrote in message news:OOiO0VzxDHA.2396@TK2MSFTNGP10.p...

File conversion #4
Money 2004 will not convert my Money 98 files. Any tricks? Please be more specific about "will not". What happens? What errors etc etc -- Regards Bob Peel, Microsoft MVP - Money For UK tips & fixes see http://support.microsoft.com/default.aspx?scid=fh;EN-GB;mny. For wishes or suggestions see http://register.microsoft.com/mswish/suggestion.asp or for UK wishes email to mnyukwsh@microsoft.com. "Todd" <wolf_creek@att.net> wrote in message news:071d01c424fd$cc636b90$a501280a@phx.gbl... > Money 2004 will not convert my Money 98 files. Any tricks? Thank...