Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: WHK en 4 Junio 2007, 03:23 am



Título: Crear caracteres especiales
Publicado por: WHK en 4 Junio 2007, 03:23 am
Como puedo hacer que mi programa acepte caracteres especiales como letras chinas?
Por ejemplo quiero poner en una caja de texto o dentro del mismo codigo fuente las letras (܃怎樣樣) (los que no tienen instalado caracteres chinos no podran verlas  ;D) para despues enviarlas por winsock a otro cliente que está en modo winsock.listen. La ides es:

winsock1.senddata Text2.Text & vbCrLf

O simplemente:

winsock1.senddata "怎樣樣怎█████████" &vbCrLfç

Pero en ves de eso envia esto: ?????¦¦¦¦¦¦¦



Título: Re: Crear caracteres especiales
Publicado por: 3k1n0x en 4 Junio 2007, 03:32 am
haces algo que le descargue e instale las fuentes con la api urldowloadto ?


Título: Re: Crear caracteres especiales
Publicado por: WHK en 4 Junio 2007, 03:44 am
El cliente ya instala por defecto ese tipo de caracteres, pero como las envio? ya que directamente no jala ni aun teniendo las fuentes instaladas.


Título: Re: Crear caracteres especiales
Publicado por: Cobac en 4 Junio 2007, 04:04 am
Creo que necesitas 4bytes para representar el carácter chino

Citar
The 16-bit fixed width encodings, such as Unicode up to and including version 2.0, are now deprecated due to the requirement to encode more characters than a 16-bit encoding can accommodate—Unicode 5.0 has some 90,000 Han characters—and the requirement by the Chinese government that software in China support the GB18030 character set.

Entonces, GB18030:

Citar
The four byte scheme can be thought of as consisting of two units, each of two bytes. Each unit has a similar format to a GBK two byte character but with a range of values for the second byte of 0x30-0x39 (the ASCII codes for decimal digits). The first byte has the range 0x81 to 0xFE, as before. This means that a string search routine that is safe for GBK should also be reasonably safe for GB18030 (in much the same way that a basic byte-oriented search routine is reasonably safe for EUC).

This gives a total of 1,587,600 (126*10*126*10) possible 4 byte sequences, which is easily sufficient to cover Unicode's 1,112,046 (17 × 65536 - 2048 surrogates - 18 noncharacters) code points.

Unfortunately, to further complicate matters there are no simple rules to translate between a 4 byte sequence and its corresponding code point. Instead, codes are allocated sequentially (with the first byte containing the most significant part and the last the least significant part) only to Unicode code points that are not mapped in any other manner.

http://en.wikipedia.org/wiki/GB18030

Quizas te pasa por esto

salu2!