果园核心“变音”德语字符问题

问题描述

我有一个 Setup.recipe.json 文件,其中存在一个带有 html 字符串的内容项,其中包含德语“变音”字符,例如 "ö"、"ü" 等。我尝试向配方文件添加几个设置,然后我还启用了所有“国际化”模块,并将此代码添加到我的 Startup.cs 文件中:

class ApiServiceTest {

    private lateinit var client: okhttp3.OkHttpClient
    private lateinit var apiService: ApiService

    @BeforeEach
    fun setup() {
        // Setup a new mock for each test case
        client = mockk(relaxed = true)
        apiService = ApiService(client)
    }

    @Test
    fun `test with mockedCallback`() {
        val mockedCall = mockk<Call>(relaxed = true) 

        every { mockedCall.enqueue(any()) } answers {
           //Get the callback from the arguments
            val callback = args[0] as Callback 
           // Create a fakeRequest 
           val fakeRequest =    okhttp3.Request.Builder().url("https://someendpoint.com.br/").build()
            // Create the response you need to test,it can be failure or success
            val errorResponse = Response.Builder()
                    .request(fakeRequest)
                    .protocol(Protocol.HTTP_1_1)
                    .code(400)
                    .message("Error")
                    .build()
            //Call the callback with the mocked response you created.
            callback.onResponse(mockedCall,errorResponse)
        }

        // Setup the client mock to return the mocked call you created
        every {
            client.newCall(any())
        } returns mockedCall

       apiService.makeApiCall()
       
       // Verify whatever you need to test your logic to handle each case.
    }

}

尽管有这些,但在保存和发布内容后,我无法在内容显示这些字符。任何帮助,将不胜感激。提前致谢。

解决方法

我建议在问题或讨论中的 https://github.com/OrchardCMS/OrchardCore 存储库中提出此类问题。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...