Have a string being returned from a modem as such;
TÁÎË ÐROÄÕCT ÖOLÕÍE TC ÖOLÕÍE ÕLLÁÇE ÈEIÇÈT WÁTER TEÍÐ
When I save the text to a document and open it in Word I am able to decode it using the "US-ASCII" encoding and get the follwing text.
TANK PRODUCT VOLUME TC VOLUME ULLAGE HEIGHT WATER TEMP
However for the life of me I cannot figure out how to acheive the same results in vb. Am using Visual Basic Express 2010.
If anyone could help I would greatly appreciate it.
Thanks
Thanks for the help. Turns out it wasn't an encoding issue as you all pointed out but rather the word length and parity both needed to be adjusted. Final settings on the modem ended up being 9600-7-Odd-1.
Related
I am a little confused, with the PUBDEF record in the OMF object format.
My assembler has generated a result which states the record is 4000 bytes, when it clearly is not so why would it do this?
Image of Hex view of OMF
The 0xa0 and 0x0f is the record length in little endian format,
please view the specificaiton: http://pierrelib.pagesperso-orange.fr/exec_formats/OMF_v1.1.pdf
It also appears to state that the strings are zero bytes in length and at one point even has just a zero string length with no string provided. Maybe I am reading the file wrong? I have spent hours now and am struggling.
If anyone can help me with my issue as I am writing a linker and cannot continue without understanding this.
Thanks
There is no PUBDEF record in the file. You seem to have miscalculated the previous record size:
0000:80 THEADR
000e:88 CoMENT
0032:96 LNAMES
0041:98 SEGDEF
004B:98 SEGDEF
0055:88 COMENT
005C:a0 LEDATA
006E:a0 LEDATA
007b:8a MODEND
Learn to use more sofisticated tools for OMF inspection, such as Tdump.exe or ODU.exe.
Firstly anyone who reads this and response, thanks for your assistance.
I'm having a problem where I have a site (primarily in English), with many translations for different language. I have a database which stores these translations. Unfortunately one of the language seems to be populated with question mark characters between each general character. Because of this, any text which contains these characters wont show up in IE.
Is there any SQL statements that will seek these characters out and remove them? There's a find/replace option, but I can't seem to find a rule that applies.
Thanks for any help you can give.
As an example, this is how text shows in a table:
�i�O�N� �k�i�t� �d�e� �s�u�p�p�o�r�t� �V�é�l�o� - which stops it showing IE.
Removing these as below will show it in IE:
iON kit de support Vélo
Any idea how I go about this?
Thanks :)
Your translation database contains mangled data that has come from misinterpreting UTF-16-encoded input as ISO-8859-1 (or the closely related Windows code page 1252; you can't tell the difference from the example data).
You could attempt to undo the damage by extracting the data, encoding it back to what is hopefully the original set of bytes, and re-decoding it, then inserting it back into the database. For example in PHP:
$mangled = "i\0O\0N\0 \0k\0i\0t\0 \0d\0e\0 \0s\0u\0p\0p\0o\0r\0t\0 \0V\0\xE9\0l\0o\0"
$fixed = iconv('utf-16le', 'utf-8', $mangled)
# "iON kit de support V\xC3\xA9lo"
but it would be best to go back to the original input data and re-import it properly really.
Just removing zero bytes from a UTF-16-encoded bytes string (str_replace("\0", '', $mangled)) isn't really fixing it, it would work for the ASCII characters (U+0000–U+007F) but you would end up with ISO-8859-1 bytes for characters U+0080–U+00FF (more usually you would want UTF-8) and any other characters outside that range would remain unreadable nonsense.
I need my DG's second column to have "Php" (Philippine Peso) which is the DG is bound in a table, and the field set to "Currency". I've tried a lot of Googling for this but they just don't work. Also something about the "CultureInfo" is really not clear to me. I just use this and have a dollar sign.
DataGridView1.Columns(1).DefaultCellStyle.Format = "c"
Can someone teach me some possible ways how to have Php Currency?
I also tried this just in case a miracle happens lol.
DataGridView1.Columns(1).DefaultCellStyle.Format = "fil-PH"
Any help and ideas greatly appreciated!
P.S.
I transferred this project in my laptop and it successfully shows "Php". Maybe it has something to do with manufacturing history already.
Newbie coder here.
First, you need the correct currency format which is uppercase C.
Me.DataGridView1.Columns(1).DefaultCellStyle.Format = "C"
Then you need the correct culture info:
Me.DataGridView1.Columns(1).DefaultCellStyle.FormatProvider = Globalization.CultureInfo.GetCultureInfo("en-PH")
You can also assign a thread specific culture info. See my answer in this post:
Questions on localization/globalization of Ctype & .ToString
I got a problem regarding ephemerides data.
The description of the ephemerides data is located here:
http://www.navcen.uscg.gov/pubs/gps/sigspec/gpssps1.pdf
I can extract the bits/bytes that are important. I just don't know how to interprete them.
It seems there is no information about that. I guess from the document that it should contain Keplerian data to calculate the position of a satellite in "WGS-84 Earth-Centered Earth-Fixed" format, which is what I need.
This document says that I can calculate the final position "utilizing a variation of the equations shown in Table 2-15"
The parameters that I need to fill into this terms are
Cus Cuc Crc Crs Cic Cis IDOT toe io
I know how long these parameters are, but not where to start to read them inside of the datastream
Looking at page 32, I see that they are there, but where they are inside of this block of "words", thats a secret for me.
Can anyone help ?
I dont ask anyone to read the whole pdf, thats a bit too much, but maybe someone has a deep knowledge regarding this topic already.
And this terms are a bit confusing, because some of them are defined recursive
A = sqrt(A^2)
vk = something * Ek
Ek = something * vk
Thanks in advance
I'm currently working on similar problems. So far the opensource library gnss-sdr has been of great help. Especially src/core/system_parametes/gps_navigation_message.cc where the function
int Gps_Navigation_Message::subframe_decoder(char *subframe)
which decodes and stores each subframe is defined.
I'm working on a licensing system for my application. I'd like to put all licensing information (licensee name, expiration date, and enabled features) into an object, encrypt that object with a private key, then represent the encrypted data as a single text string which I can send via email to my customers.
I've managed to get the encrypted data into a byte stream, but I don't know how to convert that byte stream into a text value -- something that contains no control characters or whitespace. Can anyone offer advice on how to do that? I've been researching the Encoding class, but I can't find a text-only encoding.
I'm using Net 2.0 -- mostly VB, but I can do C# also.
Use a Base64Encoder to convert it to a text string that can be decoded with a Base64Decoder. It is great for representing arbitary binary data in a text friendly manner, only upper and lower case A-Z and 0-9 digits.
BinHex is an example of one way to do that. It may not be exactly what you want -- for example, you might want to encode your data such that it's impossible to inadvertently spell words in your string, and you may or may not care about maximizing the density of information. But it's an example that may help you come up with your own encoding.
I've found Base32 useful for license keys before. There are some C# implementations linked from this answer. My own license code is based on this implementation, which avoids ambiguous characters to make it easier to retype the keys.