文本框中的德语字符 [英] German Characters in textbox

查看:75
本文介绍了文本框中的德语字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


当用户在文本框中输入德语字符时(例如??ü?)和我

尝试保存它,这些角色会被转换为不同的角色。

我该怎样防止这种情况?


Tia,

Martin

解决方案

Martin写道:


大家好,


当用户在文本框中输入德语字符(例如??ü?)和

我尝试保存它时,这些字符会转换为不同的

字符。我怎么能阻止这个?


Tia,

Martin



听起来像是'编码问题。您可能要么使用不支持字符的编码,要么使用

不同的编码来保存和检索文本。

你在哪里保存?文本文件?数据库?左口袋?


保存或取回时值是否会改变?


-

G?ran Andersson

_____
http:// www。 guffa.com


嗨G?ran,


感谢您的回复。我正在将文本保存到文本(ascii)文件中。我不是使用任何特殊编码的
,事实上我没有使用其他

字符集的经验,所以我不知道如何选择一种特殊的

编码...非常感谢任何帮助。


Tia,

Martin

" G?ran Andersson" < gu *** @ guffa.com写信息

news:ev ************** @ TK2MSFTNGP03.phx.gbl ...


Martin写道:


>大家好,

当用户输入德语时文本框中的字符(例如??ü?)和
我尝试保存它,这些字符转换为不同的字符。我该如何防止这种情况?

Tia,
Martin



听起来这是编码问题。您可能要么使用

一个不支持字符的编码,要么使用不同的

编码来保存和检索文本。

你在哪里保存?文本文件?数据库?左口袋?


保存或取回时值是否会改变?


-

G?ran Andersson

_____
http:// www。 guffa.com



Martin写道:


嗨G?ran,


感谢您的回复。我正在将文本保存到文本(ascii)文件中。我不是使用任何特殊编码的
,事实上我没有使用其他

字符集的经验,所以我不知道如何选择一种特殊的

编码...非常感谢任何帮助。



文件不包含字符,它包含字节,所以每个文本文件

使用一些编码将字符表示为字节。


ASCII编码不支持任何特殊字符。你应该使用UTF-8编码
。然而,当你没有指定任何编码时,这是框架中的方法的默认值,因此你必须使用某些其他编码来完成某些事情。


您的代码是什么样的?


-

G?ran Andersson

_____
http://www.guffa.com


Hi all,

When a user enters a german character in a textbox (such as ? ? ü ?) and I
try to save it, these characters get converted to a different character.
How can I prevent this?

Tia,
Martin

解决方案

Martin wrote:

Hi all,

When a user enters a german character in a textbox (such as ? ? ü ?) and
I try to save it, these characters get converted to a different
character. How can I prevent this?

Tia,
Martin

It sounds like it''s a problem with encoding. You are probably either
using an encoding that doesn''t support the characters, or using
different encodings for saving and retrieveing the text.

Where do you save it? Text file? Database? Left pocket?

Does the value change when you save it or when you retrieve it?

--
G?ran Andersson
_____
http://www.guffa.com


Hi G?ran,

Thanks for your reply. I''m saving the texts to a text (ascii) file. I''m not
using any special encoding, in fact I don''t have any experience using other
character sets, so I am not aware of how to choose a special kind of
encoding... Any help would be greatly appreciated.

Tia,
Martin
"G?ran Andersson" <gu***@guffa.comwrote in message
news:ev**************@TK2MSFTNGP03.phx.gbl...

Martin wrote:

>Hi all,

When a user enters a german character in a textbox (such as ? ? ü ?) and
I try to save it, these characters get converted to a different
character. How can I prevent this?

Tia,
Martin


It sounds like it''s a problem with encoding. You are probably either using
an encoding that doesn''t support the characters, or using different
encodings for saving and retrieveing the text.

Where do you save it? Text file? Database? Left pocket?

Does the value change when you save it or when you retrieve it?

--
G?ran Andersson
_____
http://www.guffa.com



Martin wrote:

Hi G?ran,

Thanks for your reply. I''m saving the texts to a text (ascii) file. I''m not
using any special encoding, in fact I don''t have any experience using other
character sets, so I am not aware of how to choose a special kind of
encoding... Any help would be greatly appreciated.

A file doesn''t contain characters, it contains bytes, so every text file
uses some encoding to represent the characters as bytes.

The ASCII encoding doesn''t support any special characters. You should
use the UTF-8 encoding. This is however the default for the methods in
the framework when you don''t specify any encoding, so you have to have
done something to use some other encoding.

What does your code look like?

--
G?ran Andersson
_____
http://www.guffa.com


这篇关于文本框中的德语字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆